mongoose-grops-acl
Usage
var mongoose = ;var acl = ; var ObjectSchema = … ;ObjectSchema; var UserSchema = … ;UserSchema;
Methods
Getting and setting the permissions for a given object:
var user = …; user;user; // => ['read', 'write', 'delete']
We can query for all objects to which a particular subject has access:
Object;
Options
Object
We can specify the path in which the ACL will be stored (by default it will be available at _acl
):
ObjectSchema;
There is one special key referred to as the public key. If set, the associated permissions will apply to all subjects:
UserSchema;
Install
npm install mongoose-groups-acl
Tests
npm test