FIX : User Roles not added to create, update or delete calls

This commit is contained in:
Francis Lessard
2016-02-11 22:16:07 -05:00
parent c66cc8d7bc
commit 42aacdf62b
2 changed files with 25 additions and 10 deletions

View File

@@ -56,12 +56,19 @@ function del(config, auth, className, objectId) {
});
}
return Promise.resolve({});
}).then(() => {
if (!auth.isMaster) {
return auth.getUserRoles();
}else{
return Promise.resolve();
}
}).then(() => {
var options = {};
if (!auth.isMaster) {
options.acl = ['*'];
if (auth.user) {
options.acl.push(auth.user.id);
options.acl = options.acl.concat(auth.userRoles);
}
}