diff options
Diffstat (limited to 'app/serializers/build_action_entity.rb')
-rw-r--r-- | app/serializers/build_action_entity.rb | 8 |
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..75dda1af709 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? && can?(request.user, :update_build, build) + end end |