Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjhampton <jhampton@gitlab.com>2018-12-03 19:56:49 +0300
committerjhampton <jhampton@gitlab.com>2018-12-03 23:33:48 +0300
commit058de0d40127e20b3068d159e053539f1e353fc3 (patch)
treeb46cb706ed12d33c2648bb84a42a09d3a586eab4 /app/serializers
parent6c83c2d8b9305fe67fe31cf944c9d83cdbb00b74 (diff)
Conditionally send variable values
We only want to send trigger variable values if the user is a maintainer.
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/trigger_variable_entity.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/serializers/trigger_variable_entity.rb b/app/serializers/trigger_variable_entity.rb
index 56203113631..8845540cc30 100644
--- a/app/serializers/trigger_variable_entity.rb
+++ b/app/serializers/trigger_variable_entity.rb
@@ -3,5 +3,6 @@
class TriggerVariableEntity < Grape::Entity
include RequestAwareEntity
- expose :key, :value, :public
+ expose :key, :public
+ expose :value, if: ->(_, _) { request.project.team.maintainer?(request.current_user) }
end