From f476cd5994c38315d2780f9b5319d416cbd6ced3 Mon Sep 17 00:00:00 2001 From: Afreen Misbah Date: Tue, 28 Apr 2026 22:25:32 +0530 Subject: [PATCH] mgr/dashboard: Update permissions for pool-manager role Fixes https://tracker.ceph.com/issues/76307 - says denied access when clicked on create pool table action - this was happening due to the failing monitor API added for stretch cluster configuration - also updates overview nav permissions Signed-off-by: Afreen Misbah --- .../pool/pool-form/pool-form.component.ts | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts index 56c182123f75..20f026a36f11 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts @@ -26,7 +26,6 @@ import { CrushRule } from '~/app/shared/models/crush-rule'; import { CrushStep } from '~/app/shared/models/crush-step'; import { ErasureCodeProfile } from '~/app/shared/models/erasure-code-profile'; import { FinishedTask } from '~/app/shared/models/finished-task'; -import { Permission } from '~/app/shared/models/permissions'; import { PoolFormInfo } from '~/app/shared/models/pool-form-info'; import { DimlessBinaryPipe } from '~/app/shared/pipes/dimless-binary.pipe'; import { AuthStorageService } from '~/app/shared/services/auth-storage.service'; @@ -40,6 +39,7 @@ import { PoolEditModeResponseModel } from '../../block/mirroring/pool-edit-mode- import { RbdMirroringService } from '~/app/shared/api/rbd-mirroring.service'; import { MonitorService } from '~/app/shared/api/monitor.service'; import { ModalCdsService } from '~/app/shared/services/modal-cds.service'; +import { Permissions } from '~/app/shared/models/permissions'; interface FormFieldDescription { externalFieldName: string; @@ -72,7 +72,7 @@ export class PoolFormComponent extends CdForm implements OnInit { isFormSubmitted = false; - permission: Permission; + permissions: Permissions; form: CdFormGroup; ecProfiles: ErasureCodeProfile[]; selectedEcp: ErasureCodeProfile; @@ -138,11 +138,11 @@ export class PoolFormComponent extends CdForm implements OnInit { } authenticate() { - this.permission = this.authStorageService.getPermissions().pool; + this.permissions = this.authStorageService.getPermissions(); if ( - !this.permission.read || - (!this.permission.update && this.editing) || - (!this.permission.create && !this.editing) + !this.permissions?.pool?.read || + (!this.permissions?.pool?.update && this.editing) || + (!this.permissions?.pool?.create && !this.editing) ) { throw new DashboardNotFoundError(); } @@ -221,13 +221,15 @@ export class PoolFormComponent extends CdForm implements OnInit { } ngOnInit() { - this.monitorService.getMonitor().subscribe((data: MonitorResponse) => { - this.isStretchMode = data?.mon_status?.stretch_mode || false; - if (this.isStretchMode) { - this.applyStretchModeRestrictions(); - } - this.replicatedRuleChange(); - }); + if (this.permissions?.monitor?.read) { + this.monitorService.getMonitor().subscribe((data: MonitorResponse) => { + this.isStretchMode = data?.mon_status?.stretch_mode || false; + if (this.isStretchMode) { + this.applyStretchModeRestrictions(); + } + this.replicatedRuleChange(); + }); + } this.poolService.getInfo().subscribe((info: PoolFormInfo) => { this.initInfo(info); if (this.editing) { -- 2.47.3