Fix user not allowed to delete itself if user

**Note: the only code required for the fix is in role.js:203**. The
other changes are to help organize debug output.
This commit is contained in:
Ritchie Martori 2013-12-11 19:15:19 -08:00
parent ad58a8ec13
commit b62b8fa47d
2 changed files with 4 additions and 4 deletions

View File

@ -34,7 +34,7 @@
var loopback = require('../loopback');
var async = require('async');
var assert = require('assert');
var debug = require('debug')('acl');
var debug = require('debug')('loopback:security:acl');
var ctx = require('./access-context');
var AccessContext = ctx.AccessContext;
@ -242,7 +242,7 @@ ACL.getStaticACLs = function getStaticACLs(model, property) {
}));
});
}
debug('getStaticACLs() returns: %s', staticACLs);
debug('getStaticACLs() returns: %j', staticACLs);
return staticACLs;
};

View File

@ -1,5 +1,5 @@
var loopback = require('../loopback');
var debug = require('debug')('role');
var debug = require('debug')('loopback:security:role');
var assert = require('assert');
var async = require('async');
@ -200,7 +200,7 @@ Role.isOwner = function isOwner(modelClass, modelId, userId, callback) {
// Is the modelClass User or a subclass of User?
if(isUserClass(modelClass)) {
process.nextTick(function() {
callback(null, modelId === userId);
callback(null, modelId == userId);
});
return;
}