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:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-04-06 18:16:19 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-04-06 18:16:19 +0300
commit7bcca2284b09e18438e6163c6ead72e10fdd2f57 (patch)
tree6a6b68004d7199921d7b501642ef544cd5515dfe /app/serializers/build_action_entity.rb
parent3e55e0742218fe20b269dfbc4f44d3798e4b0eb6 (diff)
Check branch permission in manual action entity
Diffstat (limited to 'app/serializers/build_action_entity.rb')
-rw-r--r--app/serializers/build_action_entity.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/serializers/build_action_entity.rb b/app/serializers/build_action_entity.rb
index 184b4b7a681..3d12c64b88a 100644
--- a/app/serializers/build_action_entity.rb
+++ b/app/serializers/build_action_entity.rb
@@ -13,4 +13,12 @@ class BuildActionEntity < Grape::Entity
end
expose :playable?, as: :playable
+
+ private
+
+ alias_method :build, :object
+
+ def playable?
+ build.playable? && build.can_play?(request.user)
+ end
end