@wenex/abac-lib v1.1.0
Attribute Based Access Control Library
What's the difference between RBAC and ABAC ?
Question | RBAC | ABAC |
---|---|---|
Who can access? | :heavy_check_mark: | :heavy_check_mark: |
How can operate? | :heavy_check_mark: CRUD | :heavy_check_mark: With more options |
What resource? | :white_check_mark: Does Not specify specific resource | :heavy_check_mark: More control on resource |
Where user can do? | :x: | :heavy_check_mark: Supported by IP and CIDR |
When user can do? | :x: | :white_check_mark: Work In Progress |
Best structure? | Monolithic Apps | PWA, Restfull, GraphQL |
Suitable for? | Small and medium projects | Medium and large projects |
What's the novelty of this package on action and operations?
Standard actions on Database are create C, read R, update U and delete D but if you want to have soft deleting and hard deleting together with deferent rest endpoint, how can do it?
In this package other than CRUD actions also we have Destroy, Restore, Count and Execute actions.
OK, now suppose you want to define an endpoint with distinction on query between aggregation, one, two or more collection operation, how can do it?
Rule's have Operation with Single or Multiple value that could be used for load process distinction.
Now, you want's to return owned docs after requesting an endpoint, how you can find what's access scope he/she have?
Actions are scoped in for type Any, Own, Share, Group and Other could be used for db querying purposes.
In addition you can define a specific rule for nested property of JSON object or document by field option.
Quick Start Guide
import { AccessControl } from 'wenex/abac-lib';
enum ResourceEnum {
Users = 'users',
Posts = 'posts',
}