WIP: Do not use this library. I'm updating this to modern standards
An access control library to manage and check user privileges. This library has been build to support roles and groups out of the box.
Multiple storage mechanisms are supported or can easily be created. The Mongo and Meteor (Minimongo) storage are included by default.
npm install
JSDocs found at https://chris-acl.netlify.app/
import Privileges, {MongoStorage, MeteorStorage} from 'privileges';
// Using the mongodb storage
const MongoACL = new Privileges(MongoStorage);
// Using the Meteor storage
const MeteorACL = new Privileges(MeteorStorage);
Simple checking
ACL.grant('chris', 'read');
// Simple check
ACL.can('chris', 'read'); // Returns true
//Support checking multiple privileges (OR)
ACL.can('chris', ['read', 'write']); // Returns true
// Failure scenario
ACL.can('chris', 'write'); // Returns false
Component scoped checking
ACL.grant('chris', 'read', 'userList');
// Simple check
ACL.can('chris', 'read', 'userList'); // Returns true
// Fail, because the privilege is scoped to a component
ACL.can('chris', 'read'); // Returns false
- Chris Visser - Creator - Github
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details