https://github.com/arlac77/entitlement
npm module for entitlements
https://github.com/arlac77/entitlement
Last synced: 3 months ago
JSON representation
npm module for entitlements
- Host: GitHub
- URL: https://github.com/arlac77/entitlement
- Owner: arlac77
- Created: 2012-10-03T20:00:11.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2025-05-08T22:27:55.000Z (about 1 year ago)
- Last Synced: 2025-10-26T02:51:31.140Z (8 months ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
entitlement(1) -- abstractions around roles rights and entitlements
==============================
[](https://greenkeeper.io/)
[](http://travis-ci.org/arlac77/entitlement)
entitlement = require('entitlement');
entitlement.registerRoles({
"view" : ['types.read','values.read'],
"edit" : ['types.read','values.read','types.write','values.write'],
"admin" : ['types.read','values.read']
});
entitlement.registerAccounts({
"someone@somewhere.com" : ['view'],
"mike@somewhere.com" : ['admin']
});
entitlement.accountHasEntitlement('mike@somewhere.com','types.read') // True
entitlement.accountHasEntitlement('someone@somewhere.com','types.write') // False
## Legal Stuff
"entitlement" is owned by Markus Felten. All
rights not explicitly granted in the MIT license are reserved. See the
included LICENSE file for more details.
"Node.js" and "node" are trademarks owned by Joyent, Inc.