From f6c9704621368d2ec802c2e23531cfb50c808d7d 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 (cherry picked from commit 50bf8ce2eb0ed6bd2c083169d6746baf3c0a8354) --- .../overview/overview.component.html | 27 +++++++++++-------- .../mirroring/overview/overview.component.ts | 2 ++ 2 files changed, 18 insertions(+), 11 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 c0ce32de21f..ff5d2567352 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 @@
- + }
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 134d76a5a02..8f5897e1e3e 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 @@ -52,6 +52,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 = { @@ -60,6 +61,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