UNPKG

role-acl

Version:

Role, Attribute and Condition based Access Control for Node.js

29 lines (28 loc) 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // tsc removes the code above so we document for JSDoc below. /** * An interface that defines an access information to be granted or denied. * When you start a method chain with `AccessControl#grant` or `AccessControl#deny` * methods, you're actually building this object which will eventually be * committed to the underlying grants model. * @typedef AccessControl~IAccessInfo * @type Object * * @property {String|Array<String>} role * Indicates a single or multiple roles for this access information. * * @property {String|Array<String>} resource * Indicates a single or multiple target resources for this access * information. * * @property {String|Array<String>} attributes * Defines the resource attributes which are granted. If denied, this will * default to an empty array. * * @property {String} action * Defines the type of the operation that is (or not) to be performed on * the resource(s) by the defined role(s). * See {@link ?api=ac#AccessControl.Action|`AccessControl.Action` enumeration} * for possible values. */