summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-04-06 17:16:19 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-04-06 17:16:19 +0200
commit7bcca2284b09e18438e6163c6ead72e10fdd2f57 (patch)
tree6a6b68004d7199921d7b501642ef544cd5515dfe /app
parent3e55e0742218fe20b269dfbc4f44d3798e4b0eb6 (diff)
downloadgitlab-ce-7bcca2284b09e18438e6163c6ead72e10fdd2f57.tar.gz
Check branch permission in manual action entity
Diffstat (limited to 'app')
-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