Skip to content

Commit

Permalink
sample added
Browse files Browse the repository at this point in the history
  • Loading branch information
arlac77 committed Oct 11, 2012
1 parent f03a56d commit 1efc01d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Expand Up @@ -3,6 +3,24 @@ entitlement(1) -- abstractions around roles rights and entitlements

[![Build Status](https://secure.travis-ci.org/arlac77/entitlement.png)](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
Expand Down

0 comments on commit 1efc01d

Please sign in to comment.