ui: Temporarily force all UI capabilities (#11520)
Temporarily revert to pre-1.10 UI functionality by overwriting frontend permissions. These are used to hide certain UI elements, but they are still enforced on the backend. This temporary measure should be removed again once https://github.com/hashicorp/consul/issues/11098 has been resolved
This commit is contained in:
parent
eb2b40b22d
commit
a34f81cc29
|
@ -0,0 +1,4 @@
|
||||||
|
```release-note:bug
|
||||||
|
ui: Revert to depending on the backend, 'post-user-action', to report
|
||||||
|
permissions errors rather than using UI capabilities 'pre-user-action'
|
||||||
|
```
|
|
@ -148,6 +148,18 @@ export default class PermissionService extends RepositoryService {
|
||||||
async findAll(params) {
|
async findAll(params) {
|
||||||
params.resources = REQUIRED_PERMISSIONS;
|
params.resources = REQUIRED_PERMISSIONS;
|
||||||
this.permissions = await this.findByPermissions(params);
|
this.permissions = await this.findByPermissions(params);
|
||||||
|
/**/
|
||||||
|
// Temporarily revert to pre-1.10 UI functionality by overwriting frontend
|
||||||
|
// permissions. These are used to hide certain UI elements, but they are
|
||||||
|
// still enforced on the backend.
|
||||||
|
// This temporary measure should be removed again once https://github.com/hashicorp/consul/issues/11098
|
||||||
|
// has been resolved
|
||||||
|
this.permissions.forEach(item => {
|
||||||
|
if(['key', 'node', 'service', 'intentions', 'session'].includes(item.Resource)) {
|
||||||
|
item.Allow = true;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
/**/
|
||||||
return this.permissions;
|
return this.permissions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue