Commit 0ac4169 1 parent 9477e3c commit 0ac4169 Copy full SHA for 0ac4169
File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,15 @@ type OxAccountMetadataRow = OxAccountPermissions & { id?: number; name?: OxAccou
8
8
9
9
const accountRoles = { } as Record < string , OxAccountPermissions > ;
10
10
11
+ const blacklistedGroupActions = {
12
+ addUser : true ,
13
+ removeUser : true ,
14
+ manageUser : true ,
15
+ transferOwnership : true ,
16
+ manageAccount : true ,
17
+ closeAccount : true ,
18
+ } as Record < keyof OxAccountPermissions , true > ;
19
+
11
20
export function CheckRolePermission ( roleName : OxAccountRole | null , permission : keyof OxAccountPermissions ) {
12
21
if ( ! roleName ) return ;
13
22
@@ -25,6 +34,8 @@ export async function CanPerformAction(
25
34
const groupName = ( await SelectAccount ( accountId ) ) ?. group ;
26
35
27
36
if ( groupName ) {
37
+ if ( action in blacklistedGroupActions ) return false ;
38
+
28
39
const group = GetGroup ( groupName ) ;
29
40
const groupRole = group . accountRoles [ player . getGroup ( groupName ) ] ;
30
41
You can’t perform that action at this time.
0 commit comments