kaori 3 лет назад
Родитель
Сommit
ddd81b1356
1 измененных файлов с 6 добавлено и 6 удалено
  1. 6 6
      packages/app/src/server/service/page-grant.ts

+ 6 - 6
packages/app/src/server/service/page-grant.ts

@@ -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) {