mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 09:55:44 +03:00
dx: update canCreate logic and token generation for secure var dev environment (#13438)
* ui: add logic for create permission computed property * ui: update token factory and variable ability to simulate create permissions for dev env
This commit is contained in:
@@ -24,8 +24,12 @@ export default class extends AbstractAbility {
|
||||
});
|
||||
}
|
||||
|
||||
@computed('rulesForNamespace.@each.capabilities')
|
||||
@computed('rulesForNamespace.@each.capabilities') // TODO: edit computed property to be SecureVariables.Path "DYNAMIC PATH"
|
||||
get policiesSupportVariableCreation() {
|
||||
return true; // TODO: check SecureVariables.<path>.capabilities[]
|
||||
return this.rulesForNamespace.some((rules) => {
|
||||
const keyName = `SecureVariables.Path "*".Capabilities`; // TODO: add ability to edit path, however computed properties can't take parameters
|
||||
const capabilities = get(rules, keyName) || [];
|
||||
return capabilities.includes('create');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ node {
|
||||
Capabilities: ['list-jobs', 'alloc-exec', 'read-logs'],
|
||||
SecureVariables: {
|
||||
'Path "*"': {
|
||||
Capabilities: ['list'],
|
||||
Capabilities: ['list', 'create'],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user