]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: rbd-mirroring - hide create/import token buttons for 69951/head
authorAashish Sharma <aashish@li-e9bf2ecc-2ad7-11b2-a85c-baf05c5182ab.ibm.com>
Thu, 4 Jun 2026 09:55:45 +0000 (15:25 +0530)
committerAashish Sharma <aashish@li-e9bf2ecc-2ad7-11b2-a85c-baf05c5182ab.ibm.com>
Tue, 7 Jul 2026 08:52:07 +0000 (14:22 +0530)
read-only users

Fixes: https://tracker.ceph.com/issues/77115
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
(cherry picked from commit 50bf8ce2eb0ed6bd2c083169d6746baf3c0a8354)

src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.ts

index c0ce32de21ffc2cd0fa75c368506e167eb772112..ff5d2567352d0b845f6d763c41089d61f128c893 100644 (file)
     <div cdsCol="{md:5}">
       <div class="d-flex flex-row-reverse gap-3">
         <ng-container *ngFor="let action of tableActions">
-          <button type="button"
-                  [cdsButton]="action.buttonKind"
-                  [title]="action.name"
-                  (click)="action.click($event)"
-                  [disabled]="action.disable()"
-                  [attr.aria-label]="action.name"
-                  [attr.data-testid]="action.name"
-                  [preserveFragment]="action.preserveFragment ? '' : null">
+        @if (!action.visible || action.visible(selection)) {
+          <button
+            type="button"
+            [cdsButton]="action.buttonKind"
+            [title]="action.name"
+            (click)="action.click($event)"
+            [disabled]="action.disable()"
+            [attr.aria-label]="action.name"
+            [attr.data-testid]="action.name"
+            [preserveFragment]="action.preserveFragment ? '' : null">
             <span i18n>{{ action.name }}</span>
-            <svg class="cds--btn__icon"
-                 [cdsIcon]="action.icon"
-                 size="16"></svg>
+            <svg
+              class="cds--btn__icon"
+              [cdsIcon]="action.icon"
+              size="16">
+            </svg>
           </button>
+        }
         </ng-container>
       </div>
     </div>
index 134d76a5a02027ca5b0ae74bdbeca8c7fc5a24f0..8f5897e1e3e07a444ee98df694c984c7eebfa4d3 100644 (file)
@@ -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];