Skip to content

Commit

Permalink
fix: add a few perm checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexogamer committed Jan 12, 2024
1 parent 80cd42d commit bb47fb6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,27 @@ export const BanSettingsSection = observer(({server}: {server: Server}) => {
{b.reason ?? t('app.servers.settings.bans.no_reason')}
</Text>
</View>
<Pressable
style={{
width: 30,
height: 20,
alignItems: 'center',
justifyContent: 'center',
}}
onPress={() => {
server.unbanUser(b._id.user);
triggerReload(reload + 1);
}}>
<View style={styles.iconContainer}>
<MaterialIcon
name={'delete'}
size={20}
color={currentTheme.foregroundPrimary}
/>
</View>
</Pressable>
{server.havePermission('BanMembers') ? (
<Pressable
style={{
width: 30,
height: 20,
alignItems: 'center',
justifyContent: 'center',
}}
onPress={() => {
server.unbanUser(b._id.user);
triggerReload(reload + 1);
}}>
<View style={styles.iconContainer}>
<MaterialIcon
name={'delete'}
size={20}
color={currentTheme.foregroundPrimary}
/>
</View>
</Pressable>
) : null}
</View>
))
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import MaterialIcon from 'react-native-vector-icons/MaterialIcons';

import {API, Server} from 'revolt.js';

import {currentTheme, styles} from '../../../../../Theme';
import {Text} from '../../../atoms';
import {currentTheme, styles} from '@rvmob/Theme';
import {Text} from '@rvmob/components/common/atoms';

export const InviteSettingsSection = observer(({server}: {server: Server}) => {
const {t} = useTranslation();
Expand Down Expand Up @@ -43,7 +43,7 @@ export const InviteSettingsSection = observer(({server}: {server: Server}) => {
@{i.creator} - #{i.channel}
</Text>
</View>
{i._id.length === 8 ? (
{server.havePermission('ManageServer') && i._id.length === 8 ? (
<Pressable
style={{
width: 30,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {observer} from 'mobx-react-lite';

import {Server} from 'revolt.js';

import {currentTheme} from '../../../../../Theme';
import {GapView} from '../../../../layout';
import {InputWithButton, Link, Text} from '../../../atoms';
import {currentTheme} from '@rvmob/Theme';
import {GapView} from '@rvmob/components/layout';
import {InputWithButton, Link, Text} from '@rvmob/components/common/atoms';

export const OverviewSettingsSection = observer(
({server}: {server: Server}) => {
Expand Down

0 comments on commit bb47fb6

Please sign in to comment.