PermissionManager

new PermissionManager(currentPermissions)

Creates an instance of the PermissionManager with the given permissions.
Parameters:
NameTypeDescription
currentPermissionsnumberBitmask representing the user's permissions.

Methods

canCreate() → {boolean}

Checks if the user has the 'create' permission.
Returns:
True if the user can create, false otherwise.
Type: 
boolean

canOperate() → {boolean}

Checks if the user has the 'operate' permission.
Returns:
True if the user can operate, false otherwise.
Type: 
boolean

canRead() → {boolean}

Checks if the user has the 'read' permission.
Returns:
True if the user can read, false otherwise.
Type: 
boolean

canRemove() → {boolean}

Checks if the user has the 'remove' permission.
Returns:
True if the user can remove, false otherwise.
Type: 
boolean

canSearch() → {boolean}

Checks if the user has the 'search' permission.
Returns:
True if the user can search, false otherwise.
Type: 
boolean

canUpdate() → {boolean}

Checks if the user has the 'update' permission.
Returns:
True if the user can update, false otherwise.
Type: 
boolean

isAdmin() → {boolean}

Checks if the user has the 'admin' permission.
Returns:
True if the user is an admin, false otherwise.
Type: 
boolean

isSuperAdmin() → {boolean}

Checks if the user has the 'superadmin' permission.
Returns:
True if the user is a super admin, false otherwise.
Type: 
boolean