Access Request that can be used in authorization libraries such as permit-authorize
Here using LiveScript syntax ;)
request =
user:
role: 'admin'
action: 'read'
subject: book
ctx:
domain: 'main'
AccessRequest.from(request)
Alternatively, create by sending each argument separately:
new AccessRequest(user, 'read', book, {domain: 'admin'})
The library uses fingerprint to add a fingerprint
method
to the access request, so that it is efficient to cache and re-identify in various scenarios.
The tests are written for mocha and mostly use chai expect and should as test DSLs to write the specs.
mocha test
Include
MIT License Copyright 2014-2015 Kristian Mandrup
See LICENSE file