Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "crab-rbac", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A Hierarchical Role Based Access library. Role, not Rule!", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -49,19 +49,20 @@ # crab-rbac | ||
## API | ||
**can(capability: string, ...roles: string[]): boolean** | ||
* **can(capability: string, ...roles: string[]): boolean** | ||
Returns a boolean that states if the required capability can be performed by the role(s) supplied in the arguments. | ||
**capabilitiesOf(role: string): string[]** | ||
* **capabilitiesOf(role: string): string[]** | ||
Returns all the capabilities (also the inherited ones) that a role can perform. | ||
**listRoles(): string[]** | ||
* **listRoles(): string[]** | ||
Returns all the role names loaded by the rbac library. | ||
**init(roles: Role[]): boolean** | ||
* **init(roles: Role[]): boolean** | ||
Initializes the rbac library with the list of roles provided as argument. | ||
**isInitialized(): boolean** | ||
* **isInitialized(): boolean** | ||
Tells if the library has been initialized | ||
@@ -68,0 +69,0 @@ |
8352
79