Skip to content

Commit

Permalink
Merge pull request OptimalBits#146 from nemtsov/patch-2
Browse files Browse the repository at this point in the history
remove debugging db call
  • Loading branch information
manast committed Aug 23, 2015
2 parents cef4cad + c566349 commit ec4f24a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/acl.js
Original file line number Diff line number Diff line change
Expand Up @@ -640,10 +640,12 @@ Acl.prototype.middleware = function(numPathComponents, userId, actions){
if (err){
next(new Error('Error checking permissions to access resource'));
}else if(allowed === false){
acl.logger?acl.logger.debug('Not allowed '+_actions+' on '+resource+' by user '+_userId):null;
acl.allowedPermissions(_userId, resource, function(err, obj){
acl.logger?acl.logger.debug('Allowed permissions: '+util.inspect(obj)):null;
});
if (acl.logger) {
acl.logger.debug('Not allowed '+_actions+' on '+resource+' by user '+_userId);
acl.allowedPermissions(_userId, resource, function(err, obj){
acl.logger.debug('Allowed permissions: '+util.inspect(obj));
});
}
next(new HttpError(403,'Insufficient permissions to access resource'));
}else{
acl.logger?acl.logger.debug('Allowed '+_actions+' on '+resource+' by user '+_userId):null;
Expand Down

0 comments on commit ec4f24a

Please sign in to comment.