From 152e64be1c7104fc81cd0b295356587b4c6fd28d Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Thu, 25 Nov 2021 20:54:39 +0100 Subject: [PATCH] fix(core): Fix permissions for `pendingSearchIndexUpdates` query --- packages/core/src/api/resolvers/admin/search.resolver.ts | 2 +- .../default-search-plugin/api/fulltext-search.resolver.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/api/resolvers/admin/search.resolver.ts b/packages/core/src/api/resolvers/admin/search.resolver.ts index 1a2b0ba644..fb38653489 100644 --- a/packages/core/src/api/resolvers/admin/search.resolver.ts +++ b/packages/core/src/api/resolvers/admin/search.resolver.ts @@ -32,7 +32,7 @@ export class SearchResolver { } @Query() - @Allow(Permission.UpdateCatalog, Permission.UpdateProduct) + @Allow(Permission.ReadCatalog, Permission.ReadProduct) async pendingSearchIndexUpdates(...args: any[]): Promise { throw new InternalServerError(`error.no-search-plugin-configured`); } diff --git a/packages/core/src/plugin/default-search-plugin/api/fulltext-search.resolver.ts b/packages/core/src/plugin/default-search-plugin/api/fulltext-search.resolver.ts index 0f2c78133b..574147254c 100644 --- a/packages/core/src/plugin/default-search-plugin/api/fulltext-search.resolver.ts +++ b/packages/core/src/plugin/default-search-plugin/api/fulltext-search.resolver.ts @@ -95,7 +95,7 @@ export class AdminFulltextSearchResolver implements BaseSearchResolver { } @Query() - @Allow(Permission.UpdateCatalog, Permission.UpdateProduct) + @Allow(Permission.ReadCatalog, Permission.ReadProduct) async pendingSearchIndexUpdates(...args: any[]): Promise { return this.searchJobBufferService.getPendingSearchUpdates(); }