|
@@ -176,13 +176,14 @@ class PageGroupRelation {
|
|
|
* @returns is exists granted group(or not)
|
|
* @returns is exists granted group(or not)
|
|
|
* @memberof PageGroupRelation
|
|
* @memberof PageGroupRelation
|
|
|
*/
|
|
*/
|
|
|
- static isExistsGrantedGroupForPageAndUser(pageData, userData) {
|
|
|
|
|
- var UserGroupRelation = PageGroupRelation.crowi.model('UserGroupRelation');
|
|
|
|
|
|
|
+ static async isExistsGrantedGroupForPageAndUser(pageData, userData) {
|
|
|
|
|
+ const UserGroupRelation = PageGroupRelation.crowi.model('UserGroupRelation');
|
|
|
|
|
|
|
|
- return this.findByPage(pageData)
|
|
|
|
|
- .then(pageRelation => {
|
|
|
|
|
- return UserGroupRelation.isRelatedUserForGroup(userData, pageRelation.relatedGroup);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ const pageRelation = await this.findByPage(pageData);
|
|
|
|
|
+ if (pageRelation == null) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ return await UserGroupRelation.isRelatedUserForGroup(userData, pageRelation.relatedGroup);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|