|
|
@@ -408,12 +408,6 @@ class PageGrantService {
|
|
|
const Page = mongoose.model('Page') as unknown as PageModel;
|
|
|
const UserGroupRelation = mongoose.model('UserGroupRelation') as any; // TODO: Typescriptize model
|
|
|
|
|
|
- // Increment an object (type IRecordApplicableGrant)
|
|
|
- // grant is never public, anyone with the link, nor specified
|
|
|
- const data: IRecordApplicableGrant = {
|
|
|
- [Page.GRANT_RESTRICTED]: null, // any page can be restricted
|
|
|
- };
|
|
|
-
|
|
|
// -- Public only if top page
|
|
|
const isOnlyPublicApplicable = isTopPage(page.path);
|
|
|
if (isOnlyPublicApplicable) {
|
|
|
@@ -422,6 +416,12 @@ class PageGrantService {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
+ // Increment an object (type IRecordApplicableGrant)
|
|
|
+ // grant is never public, anyone with the link, nor specified
|
|
|
+ const data: IRecordApplicableGrant = {
|
|
|
+ [Page.GRANT_RESTRICTED]: null, // any page can be restricted
|
|
|
+ };
|
|
|
+
|
|
|
// -- Any grant is allowed if parent is null
|
|
|
const isAnyGrantApplicable = page.parent == null;
|
|
|
if (isAnyGrantApplicable) {
|