new PermissionManager(currentPermissions)
Creates an instance of the PermissionManager with the given permissions.
Parameters:
| Name | Type | Description |
|---|---|---|
currentPermissions | number | Bitmask representing the user's permissions. |
- Source
Methods
canCreate() → {boolean}
Checks if the user has the 'create' permission.
- Source
Returns:
True if the user can create, false otherwise.
- Type:
- boolean
canOperate() → {boolean}
Checks if the user has the 'operate' permission.
- Source
Returns:
True if the user can operate, false otherwise.
- Type:
- boolean
canRead() → {boolean}
Checks if the user has the 'read' permission.
- Source
Returns:
True if the user can read, false otherwise.
- Type:
- boolean
canRemove() → {boolean}
Checks if the user has the 'remove' permission.
- Source
Returns:
True if the user can remove, false otherwise.
- Type:
- boolean
canSearch() → {boolean}
Checks if the user has the 'search' permission.
- Source
Returns:
True if the user can search, false otherwise.
- Type:
- boolean
canUpdate() → {boolean}
Checks if the user has the 'update' permission.
- Source
Returns:
True if the user can update, false otherwise.
- Type:
- boolean
isAdmin() → {boolean}
Checks if the user has the 'admin' permission.
- Source
Returns:
True if the user is an admin, false otherwise.
- Type:
- boolean
isSuperAdmin() → {boolean}
Checks if the user has the 'superadmin' permission.
- Source
Returns:
True if the user is a super admin, false otherwise.
- Type:
- boolean