From 481d6e46996dc1ae40d6468358371297cfd0fbb5 Mon Sep 17 00:00:00 2001 From: Abhishek Desai Date: Mon, 20 Jul 2026 17:15:53 +0530 Subject: [PATCH] mgr/dashboard : Access denied issue for settings icon fixes : https://tracker.ceph.com/issues/78407 Signed-off-by: Abhishek Desai --- .../overview/overview.component.html | 26 ++-- .../overview/overview.component.spec.ts | 3 +- .../administration.component.html | 29 +++-- .../administration.component.spec.ts | 120 ++++++++++++++---- .../navigation/navigation.component.html | 16 ++- .../navigation/navigation.component.spec.ts | 27 ++++ .../services/api-interceptor.service.spec.ts | 16 ++- .../services/api-interceptor.service.ts | 9 +- 8 files changed, 186 insertions(+), 60 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.html index 19d2bfcf5c3..f9443116617 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.html @@ -29,19 +29,21 @@ size="md" (click)="updateSiteName()" [title]="editing ? 'Save' : 'Edit'" + data-testid="site-name-edit-btn" > - - + @if (!editing) { + + } @else { + + } } { }); describe('site name edit button visibility', () => { - const editButton = () => fixture.debugElement.query(By.css('cds-icon-button')); + const editButton = () => + fixture.debugElement.query(By.css('[data-testid="site-name-edit-btn"]')); it('should show the edit button when user has update permission', () => { component.permission = new Permission(['read', 'update']); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/administration/administration.component.html b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/administration/administration.component.html index 804c4dbc566..98747b9debf 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/administration/administration.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/administration/administration.component.html @@ -3,16 +3,18 @@ [flip]="true" description="" > -
  • - -
  • + @if (userPermission.create || userPermission.update || userPermission.delete) { +
  • + +
  • + } @if (configOptPermission.read) {