|
|
@@ -801,10 +801,11 @@ module.exports = function(crowi) {
|
|
|
pageSchema.statics.updateGrant = function(page, grant, userData, grantUserGroupId) {
|
|
|
var Page = this;
|
|
|
|
|
|
- if (grant == GRANT_USER_GROUP && grantUserGroupId == null) {
|
|
|
- throw new Error('grant userGroupId is not specified');
|
|
|
- }
|
|
|
return new Promise(function(resolve, reject) {
|
|
|
+ if (grant == GRANT_USER_GROUP && grantUserGroupId == null) {
|
|
|
+ reject('grant userGroupId is not specified');
|
|
|
+ }
|
|
|
+
|
|
|
page.grant = grant;
|
|
|
if (grant == GRANT_PUBLIC || grant == GRANT_USER_GROUP) {
|
|
|
page.grantedUsers = [];
|
|
|
@@ -981,9 +982,6 @@ module.exports = function(crowi) {
|
|
|
resolve(pageData);
|
|
|
pageEvent.emit('update', pageData, user);
|
|
|
}
|
|
|
- }).catch(function(err) {
|
|
|
- debug('Error on update', err);
|
|
|
- debug('Error on update', err.stack);
|
|
|
});
|
|
|
});
|
|
|
};
|