Module: permissions-dal

Methods

(static) create(action, resource) → {Promise.<void>}

Create a new Permission entry if the permission already exists returns the existing permission
Parameters:
Name Type Description
action string
resource string
Source:
Returns:
Type
Promise.<void>

(static) delete(id) → {Promise.<void>}

Deletes the Permission through the given id
Parameters:
Name Type Description
id int
Source:
Returns:
Type
Promise.<void>

(static) get() → {Promise.<void>}

Returns all existing Permissions
Source:
Returns:
Type
Promise.<void>

(static) getSpecific(action, resource) → {Promise.<*>}

Returns a Permission through the given resource and action.
Parameters:
Name Type Description
action string
resource string
Source:
Returns:
Type
Promise.<*>

(static) getSpecificById(id) → {Promise.<void>}

Returns a Permission by its id
Parameters:
Name Type Description
id int
Source:
Returns:
Type
Promise.<void>

(static) update(id, action, resource) → {Promise.<{resource: *, insertedRows: (Object|Error), action: *, id: *}>}

Changes the action and resource of the Permission specified by the id.
Parameters:
Name Type Description
id int
action string
resource string
Source:
Returns:
Type
Promise.<{resource: *, insertedRows: (Object|Error), action: *, id: *}>