From: Aashish Sharma Date: Thu, 4 Jun 2026 09:55:45 +0000 (+0530) Subject: mgr/dashboard: rbd-mirroring - hide create/import token buttons for X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=50bf8ce2eb0ed6bd2c083169d6746baf3c0a8354;p=ceph.git 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 --- 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];