diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2018-10-22 21:45:45 +0200 |
---|---|---|
committer | Winnie Hellmann <winnie@gitlab.com> | 2018-10-22 22:07:54 +0200 |
commit | fc0e99df9f1c232a1d292137000e8ffebea1b259 (patch) | |
tree | 9eccf5a021fa4a3e3b7655a88943fd3da6e1b8f8 /app | |
parent | 8ab27e64fe307ec75032a0597fd96caa80e40b67 (diff) | |
download | gitlab-ce-fc0e99df9f1c232a1d292137000e8ffebea1b259.tar.gz |
Add permission check for delayed job actions
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/environments/components/environment_item.vue | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/app/assets/javascripts/environments/components/environment_item.vue b/app/assets/javascripts/environments/components/environment_item.vue index f2fb0074ea1..eb51118dcf2 100644 --- a/app/assets/javascripts/environments/components/environment_item.vue +++ b/app/assets/javascripts/environments/components/environment_item.vue @@ -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), |