don't check capabilities before rendering the credentials route (#4446)
This commit is contained in:
parent
e29bf3df61
commit
8d820fd02e
|
@ -10,14 +10,6 @@ export default Ember.Route.extend(UnloadModel, {
|
|||
return this.modelFor('vault.cluster.secrets.backend');
|
||||
},
|
||||
|
||||
pathQuery(role, backend) {
|
||||
const type = this.backendModel().get('type');
|
||||
if (type === 'pki') {
|
||||
return `${backend}/issue/${role}`;
|
||||
}
|
||||
return `${backend}/creds/${role}`;
|
||||
},
|
||||
|
||||
model(params) {
|
||||
const role = params.secret;
|
||||
const backendModel = this.backendModel();
|
||||
|
@ -26,18 +18,11 @@ export default Ember.Route.extend(UnloadModel, {
|
|||
if (!SUPPORTED_DYNAMIC_BACKENDS.includes(backendModel.get('type'))) {
|
||||
return this.transitionTo('vault.cluster.secrets.backend.list-root', backend);
|
||||
}
|
||||
return this.store
|
||||
.queryRecord('capabilities', { id: this.pathQuery(role, backend) })
|
||||
.then(capabilities => {
|
||||
if (!capabilities.get('canUpdate')) {
|
||||
return this.transitionTo('vault.cluster.secrets.backend.list-root', backend);
|
||||
}
|
||||
return Ember.RSVP.resolve({
|
||||
backend,
|
||||
id: role,
|
||||
name: role,
|
||||
});
|
||||
});
|
||||
return Ember.RSVP.resolve({
|
||||
backend,
|
||||
id: role,
|
||||
name: role,
|
||||
});
|
||||
},
|
||||
|
||||
setupController(controller) {
|
||||
|
|
Loading…
Reference in New Issue