From 11dedd7cf318789c89e62e97d793b7e63eaa8ac1 Mon Sep 17 00:00:00 2001 From: naumov Date: Wed, 21 Feb 2024 15:26:24 +0100 Subject: [PATCH] CB-4700 allow editing for admin --- .../packages/plugin-data-viewer/src/DataViewerService.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webapp/packages/plugin-data-viewer/src/DataViewerService.ts b/webapp/packages/plugin-data-viewer/src/DataViewerService.ts index e36d6f32e3..98d125ab8d 100644 --- a/webapp/packages/plugin-data-viewer/src/DataViewerService.ts +++ b/webapp/packages/plugin-data-viewer/src/DataViewerService.ts @@ -27,7 +27,13 @@ export class DataViewerService { ) {} isDataEditable(connection: Connection) { + const isAdmin = this.sessionPermissionsResource.has(EAdminPermission.admin); const disabled = this.dataViewerSettingsService.settings.getValue('disableEdit'); - return !disabled && !connection.readOnly; + + if (disabled) { + return isAdmin; + } + + return !connection.readOnly; } }