Merge pull request #246 from haio/master

Convert principalId to String
This commit is contained in:
Raymond Feng 2014-04-29 11:16:28 -07:00
commit 1077a7f288
1 changed files with 3 additions and 0 deletions

View File

@ -296,6 +296,9 @@ ACL.getStaticACLs = function getStaticACLs(model, property) {
ACL.checkPermission = function checkPermission(principalType, principalId,
model, property, accessType,
callback) {
if(principalId !== null && principalId !== undefined && (typeof principalId !== 'string') ) {
principalId = principalId.toString();
}
property = property || ACL.ALL;
var propertyQuery = (property === ACL.ALL) ? undefined : {inq: [property, ACL.ALL]};
accessType = accessType || ACL.ALL;