Class: Permissions

Permissions(permissionsopt, bitsopt)

Create a Permissions class.

Constructor

new Permissions(permissionsopt, bitsopt)

Parameters:
Name Type Attributes Default Description
permissions Array.<Object> <optional>
The list of permissions.
bits Bits <optional>
0 Actual permissions of user.
Source:

Members

permissionCalc :number

Return the permissions of member as a number.
Type:
  • number
Source:

totalBits :number

Return all permissions as a integer.
Type:
  • number
Source:

Methods

calculate(permissions) → {number}

Parameters:
Name Type Description
permissions string | Array.<string>
Source:
Returns:
Type
number

hasPermissions(permissionopt) → {boolean}

Parameters:
Name Type Attributes Description
permission Array.<string> | String | Number <optional>
The
Source:
Returns:
Type
boolean

toArray() → {Array.<string>}

Return the permissions of user as an array
Source:
Returns:
Type
Array.<string>