From 50bf8ce2eb0ed6bd2c083169d6746baf3c0a8354 Mon Sep 17 00:00:00 2001 From: Aashish Sharma Date: Thu, 4 Jun 2026 15:25:45 +0530 Subject: [PATCH] mgr/dashboard: rbd-mirroring - hide create/import token buttons for read-only users Fixes: https://tracker.ceph.com/issues/77115 Signed-off-by: Aashish Sharma --- .../overview/overview.component.html | 31 +++++++++++-------- .../mirroring/overview/overview.component.ts | 2 ++ 2 files changed, 20 insertions(+), 13 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 0e708ed4354..440d6fb100a 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 @@ -37,19 +37,24 @@
- + @if (!action.visible || action.visible(selection)) { + + }
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.ts index c4fef43e021..efe1d53ea96 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.ts @@ -53,6 +53,7 @@ export class OverviewComponent implements OnInit, OnDestroy { name: $localize`Create Bootstrap Token`, canBePrimary: () => true, disable: () => false, + visible: () => this.permission.update, buttonKind: 'primary' }; const importBootstrapAction: CdTableAction = { @@ -61,6 +62,7 @@ export class OverviewComponent implements OnInit, OnDestroy { click: () => this.importBootstrapModal(), name: $localize`Import Bootstrap Token`, disable: () => false, + visible: () => this.permission.update, buttonKind: 'tertiary' }; this.tableActions = [createBootstrapAction, importBootstrapAction]; -- 2.47.3