PermissionLevels()

A helper class to building valid permission structures

new PermissionLevels()

Creates a new PermissionLevels

Members

levels :Map

A cache of levels submitted with addLevel

readonly structure :validPermStructure

The current valid permissions structure

Methods

addLevel(level, brk, check) → {PermissionLevels}

Adds levels to the levels cache to be converted to valid permission structure
Parameters:
Name Type Description
level number The permission number for the level you are defining
brk boolean Whether the level should break (stop processing higher levels, and inhibit a no permission error)
check function The permission checking function
Returns:
PermissionLevels - This permission levels

Type Definitions

permLevel

Properties:
Name Type Description
break boolean Whether the level should break (stop processing higher levels, and inhibit a no permission error)
check function The permission checking function

validPermStructure

Permission levels indexed from 0-11, based on the level number