summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2018-10-22 21:45:45 +0200
committerWinnie Hellmann <winnie@gitlab.com>2018-10-22 22:07:54 +0200
commitfc0e99df9f1c232a1d292137000e8ffebea1b259 (patch)
tree9eccf5a021fa4a3e3b7655a88943fd3da6e1b8f8
parent8ab27e64fe307ec75032a0597fd96caa80e40b67 (diff)
downloadgitlab-ce-fc0e99df9f1c232a1d292137000e8ffebea1b259.tar.gz
Add permission check for delayed job actions
-rw-r--r--app/assets/javascripts/environments/components/environment_item.vue8
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),