Skip to content
On this page

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

ts
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

NameType
documentT & PermissionGroup
groupNamestring
valuestring | 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

NameType
documentPermissionGroup
groupNamestring
permissionsstring[]

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

NameType
documentsPermissionGroup[]
groupNamestring
permissionstring

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

NameType
documentPermissionGroup
groupNamestring

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

NameType
documentPermissionGroup
groupNamestring
permissionstring

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

NameType
documentT & PermissionGroup
groupNamestring

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

NameType
documentT & PermissionGroup
groupNamestring
valuestring | string[]

Returns

T & PermissionGroup

Defined in

server/systems/permissionGroup.ts:67

Created by Stuyk | Est. 2020