Athena.systems.permissionGroup ​
Interfaces ​
Functions ​
addGroupPerm ​
Usage
Athena.systems.permissionGroup.addGroupPerm<T
>(document
, groupName
, value
): T
& PermissionGroup
Add a group key to a document, and return the document.
Document can be anything.
Example ​
const data = Athena.document.character.get(somePlayer);
if (!data) {
return;
}
const modifiedDocument = Athena.systems.permissionGroup.addGroupKey<typeof data>(data, 'police', 'police-chief');
await Athena.document.character.set(somePlayer, 'groups', modifiedDocument.groups);
Export
Type parameters ​
Name |
---|
T |
Parameters ​
Name | Type |
---|---|
document | T & PermissionGroup |
groupName | string |
value | string | string [] |
Returns ​
T
& PermissionGroup
Defined in ​
server/systems/permissionGroup.ts:28
hasAtLeastOneGroupPerm ​
Usage
Athena.systems.permissionGroup.hasAtLeastOneGroupPerm(document
, groupName
, permissions
): boolean
Check if a specific document has any of the listed permissions.
Export
Parameters ​
Name | Type |
---|---|
document | PermissionGroup |
groupName | string |
permissions | string [] |
Returns ​
boolean
Defined in ​
server/systems/permissionGroup.ts:168
hasCommonPermission ​
Usage
Athena.systems.permissionGroup.hasCommonPermission(documents
, groupName
, permission
): boolean
Checks if the given documents have a common permission.
Name
hasCommonPermission
Exports
Parameters ​
Name | Type |
---|---|
documents | PermissionGroup [] |
groupName | string |
permission | string |
Returns ​
boolean
Defined in ​
server/systems/permissionGroup.ts:203
hasGroup ​
Usage
Athena.systems.permissionGroup.hasGroup(document
, groupName
): boolean
Checks if the documet is part of a group.
Export
Parameters ​
Name | Type |
---|---|
document | PermissionGroup |
groupName | string |
Returns ​
boolean
Defined in ​
server/systems/permissionGroup.ts:127
hasGroupPerm ​
Usage
Athena.systems.permissionGroup.hasGroupPerm(document
, groupName
, permission
): boolean
Check if a document has a specific group permission.
Export
Parameters ​
Name | Type |
---|---|
document | PermissionGroup |
groupName | string |
permission | string |
Returns ​
boolean
Defined in ​
server/systems/permissionGroup.ts:148
removeGroup ​
Usage
Athena.systems.permissionGroup.removeGroup<T
>(document
, groupName
): T
& PermissionGroup
Removes a group entirely from a document.
Export
Type parameters ​
Name |
---|
T |
Parameters ​
Name | Type |
---|---|
document | T & PermissionGroup |
groupName | string |
Returns ​
T
& PermissionGroup
Defined in ​
server/systems/permissionGroup.ts:110
removeGroupPerm ​
Usage
Athena.systems.permissionGroup.removeGroupPerm<T
>(document
, groupName
, value
): T
& PermissionGroup
Remove a permission from a group key.
Export
Type parameters ​
Name |
---|
T |
Parameters ​
Name | Type |
---|---|
document | T & PermissionGroup |
groupName | string |
value | string | string [] |
Returns ​
T
& PermissionGroup