Tables acl_users and acl_meta. Required clarifications
Hello,
I would like to clarify few aspects. I am using MonogoDB for storing ACL data
Function addUserRoles add record to acl_users and acl_meta documents. However when I run removeUserRoles function records remains in acl_users and acl_meta.
Is this expected behaviour ? Could you please clarify what is the correct way to remove data from acl_users and acl_meta ?
Thank you very much,
Best Regards, Andrew
+1,
I can be wrong, but seems that
meta/users is never used in code, only write/remove
meta/roles is reads only once, in other places same, only write/remove
in removeResource
...
return this.backend.getAsync(this.options.buckets.meta, 'roles')
...
not best way to handle it. I have a lot of roles, in app and managing meta's now a bottleneck.
removeResource is also a bottleneck on my side.
Acl.prototype.removeResource = function(resource, cb){
contract(arguments)
.params('string', 'function')
.params('string')
.end();
var _this = this;
return this.backend.getAsync(this.options.buckets.meta, 'roles').then(function(roles){
// having deeb hirarchy roles are over 3000 in my case
var transaction = _this.backend.begin();
_this.backend.del(transaction, allowsBucket(resource), roles);
roles.forEach(function(role){
_this.backend.remove(transaction, _this.options.buckets.resources, role, resource);
})
return _this.backend.endAsync(transaction);
}).nodeify(cb)
};