summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pipelines/components/header_component.vue
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/pipelines/components/header_component.vue')
-rw-r--r--app/assets/javascripts/pipelines/components/header_component.vue14
1 files changed, 12 insertions, 2 deletions
diff --git a/app/assets/javascripts/pipelines/components/header_component.vue b/app/assets/javascripts/pipelines/components/header_component.vue
index d8e7b83a8c1..b7500ef00b0 100644
--- a/app/assets/javascripts/pipelines/components/header_component.vue
+++ b/app/assets/javascripts/pipelines/components/header_component.vue
@@ -132,6 +132,16 @@ export default {
};
}
},
+ canRetryPipeline() {
+ const { retryable, userPermissions } = this.pipeline;
+
+ return retryable && userPermissions.updatePipeline;
+ },
+ canCancelPipeline() {
+ const { cancelable, userPermissions } = this.pipeline;
+
+ return cancelable && userPermissions.updatePipeline;
+ },
},
watch: {
isFinished(finished) {
@@ -219,7 +229,7 @@ export default {
item-name="Pipeline"
>
<gl-button
- v-if="pipeline.retryable"
+ v-if="canRetryPipeline"
:loading="isRetrying"
:disabled="isRetrying"
category="secondary"
@@ -232,7 +242,7 @@ export default {
</gl-button>
<gl-button
- v-if="pipeline.cancelable"
+ v-if="canCancelPipeline"
:loading="isCanceling"
:disabled="isCanceling"
class="gl-ml-3"