|
@@ -3461,7 +3461,7 @@ class PageService {
|
|
|
try {
|
|
try {
|
|
|
// It must check descendants as well if emptyTarget is not null
|
|
// It must check descendants as well if emptyTarget is not null
|
|
|
const isEmptyPageAlreadyExist = await Page.count({ path, isEmpty: true }) > 0;
|
|
const isEmptyPageAlreadyExist = await Page.count({ path, isEmpty: true }) > 0;
|
|
|
- const shouldCheckDescendants = isEmptyPageAlreadyExist;
|
|
|
|
|
|
|
+ const shouldCheckDescendants = isEmptyPageAlreadyExist && !options?.overwriteScopesOfDescendants;
|
|
|
|
|
|
|
|
isGrantNormalized = await this.crowi.pageGrantService.isGrantNormalized(user, path, grant, grantedUserIds, grantUserGroupId, shouldCheckDescendants);
|
|
isGrantNormalized = await this.crowi.pageGrantService.isGrantNormalized(user, path, grant, grantedUserIds, grantUserGroupId, shouldCheckDescendants);
|
|
|
}
|
|
}
|
|
@@ -3512,7 +3512,7 @@ class PageService {
|
|
|
|
|
|
|
|
// Validate
|
|
// Validate
|
|
|
const shouldValidateGrant = !isGrantRestricted;
|
|
const shouldValidateGrant = !isGrantRestricted;
|
|
|
- const canProcessCreate = await this.canProcessCreate(path, grantData, shouldValidateGrant, user);
|
|
|
|
|
|
|
+ const canProcessCreate = await this.canProcessCreate(path, grantData, shouldValidateGrant, user, options);
|
|
|
if (!canProcessCreate) {
|
|
if (!canProcessCreate) {
|
|
|
throw Error('Cannnot process create');
|
|
throw Error('Cannnot process create');
|
|
|
}
|
|
}
|