Add more check on principalId
This commit is contained in:
parent
aa63d7bf4b
commit
f44d737e7e
|
@ -296,7 +296,9 @@ ACL.getStaticACLs = function getStaticACLs(model, property) {
|
||||||
ACL.checkPermission = function checkPermission(principalType, principalId,
|
ACL.checkPermission = function checkPermission(principalType, principalId,
|
||||||
model, property, accessType,
|
model, property, accessType,
|
||||||
callback) {
|
callback) {
|
||||||
principalId = principalId.toString();
|
if(principalId !== null && principalId !== undefined && (typeof principalId !== 'string') ) {
|
||||||
|
principlaId = principalId.toString();
|
||||||
|
}
|
||||||
property = property || ACL.ALL;
|
property = property || ACL.ALL;
|
||||||
var propertyQuery = (property === ACL.ALL) ? undefined : {inq: [property, ACL.ALL]};
|
var propertyQuery = (property === ACL.ALL) ? undefined : {inq: [property, ACL.ALL]};
|
||||||
accessType = accessType || ACL.ALL;
|
accessType = accessType || ACL.ALL;
|
||||||
|
|
Loading…
Reference in New Issue