Browse Source

do not include search results

Shun Miyazawa 4 years ago
parent
commit
9d8ee164b9
1 changed files with 1 additions and 15 deletions
  1. 1 15
      packages/app/src/server/service/search-delegator/elasticsearch.ts

+ 1 - 15
packages/app/src/server/service/search-delegator/elasticsearch.ts

@@ -857,27 +857,13 @@ class ElasticsearchDelegator implements SearchDelegator<Data> {
 
 
     const Page = mongoose.model('Page') as unknown as PageModel;
     const Page = mongoose.model('Page') as unknown as PageModel;
     const {
     const {
-      GRANT_PUBLIC, GRANT_RESTRICTED, GRANT_SPECIFIED, GRANT_OWNER, GRANT_USER_GROUP,
+      GRANT_PUBLIC, GRANT_SPECIFIED, GRANT_OWNER, GRANT_USER_GROUP,
     } = Page;
     } = Page;
 
 
     const grantConditions: any[] = [
     const grantConditions: any[] = [
       { term: { grant: GRANT_PUBLIC } },
       { term: { grant: GRANT_PUBLIC } },
     ];
     ];
 
 
-    // ensure to hit to GRANT_RESTRICTED pages that the user specified at own
-    if (user != null) {
-      grantConditions.push(
-        {
-          bool: {
-            must: [
-              { term: { grant: GRANT_RESTRICTED } },
-              { term: { granted_users: user._id.toString() } },
-            ],
-          },
-        },
-      );
-    }
-
     if (showPagesRestrictedByOwner) {
     if (showPagesRestrictedByOwner) {
       grantConditions.push(
       grantConditions.push(
         { term: { grant: GRANT_SPECIFIED } },
         { term: { grant: GRANT_SPECIFIED } },