Add permission check for delayed job actions

This commit is contained in:
Winnie Hellmann 2018-10-22 21:45:45 +02:00
parent 8ab27e64fe
commit fc0e99df9f

View file

@ -141,7 +141,7 @@ export default {
},
actions() {
if (!this.model || !this.model.last_deployment) {
if (!this.model || !this.model.last_deployment || !this.canCreateDeployment) {
return [];
}
@ -149,11 +149,7 @@ export default {
this.model.last_deployment,
{ deep: true },
);
let combinedActions = [];
if (this.canCreateDeployment) {
combinedActions = combinedActions.concat(manualActions || []);
}
combinedActions = combinedActions.concat(scheduledActions || []);
const combinedActions = (manualActions || []).concat(scheduledActions || []);
return combinedActions.map(action => ({
...action,
name: humanize(action.name),