MCPcopy Create free account
hub / github.com/OptimalBits/node_acl / Acl

Function Acl

lib/acl.js:41–68  ·  view source on GitHub ↗
(backend, logger, options)

Source from the content-addressed store, hash-verified

39contract.debug = true;
40
41var Acl = function (backend, logger, options){
42 contract(arguments)
43 .params('object')
44 .params('object','object')
45 .params('object','object', 'object')
46 .end();
47
48 options = _.extend({
49 buckets: {
50 meta: 'meta',
51 parents: 'parents',
52 permissions: 'permissions',
53 resources: 'resources',
54 roles: 'roles',
55 users: 'users'
56 }
57 }, options);
58
59 this.logger = logger;
60 this.backend = backend;
61 this.options = options;
62
63 // Promisify async methods
64 backend.endAsync = bluebird.promisify(backend.end);
65 backend.getAsync = bluebird.promisify(backend.get);
66 backend.cleanAsync = bluebird.promisify(backend.clean);
67 backend.unionAsync = bluebird.promisify(backend.union);
68};
69
70/**
71 addUserRoles( userId, roles, function(err) )

Callers

nothing calls this directly

Calls 1

contractFunction · 0.85

Tested by

no test coverage detected