this.data.pgs = this.form.getValue('pgNum');
this.data.applications.selected = pool.application_metadata;
this.setAvailableApps(this.data.applications.default.concat(pool.application_metadata));
- this.rbdMirroringService
- .getPool(pool.pool_name)
- .subscribe((resp: PoolEditModeResponseModel) => {
- this.form.get('rbdMirroring').setValue(resp.mirror_mode === 'pool');
- });
+ if (this.permissions?.rbdMirroring?.read) {
+ this.rbdMirroringService
+ .getPool(pool.pool_name)
+ .subscribe((resp: PoolEditModeResponseModel) => {
+ this.form.get('rbdMirroring').setValue(resp.mirror_mode === 'pool');
+ });
+ }
}
private setAvailableApps(apps: string[] = this.data.applications.default) {
formControlName: 'ecOverwrites',
replaceFn: () => (this.isErasure ? ['ec_overwrites'] : undefined)
});
-
+ if (this.editing) {
+ this.assignFormFields(pool, [
+ {
+ externalFieldName: 'srcpool',
+ formControlName: 'name',
+ editable: true,
+ replaceFn: () => this.data.pool.pool_name
+ }
+ ]);
+ }
if (this.form.getValue('mode') !== 'none') {
this.assignFormFields(pool, [
{
formControlName: 'mode',
editable: true,
replaceFn: () => 'unset' // Is used if no compression is set
- },
- {
- externalFieldName: 'srcpool',
- formControlName: 'name',
- editable: true,
- replaceFn: () => this.data.pool.pool_name
}
]);
}
this.monAllowPoolDelete = monSection.value === 'true' ? true : false;
}
});
+ } else if (this.permissions.pool.read) {
+ /*
+ `monAllowPoolDelete` will always be `false`,
+ because no read permissions for reading config settings.
+ Hence enabling by default for pool based roles which allow CRUD.
+ @TODO: Fix once permissions of config-opt are sorted.
+ */
+ this.monAllowPoolDelete = true;
}
}