Check branch permission in manual action entity

This commit is contained in:
Grzegorz Bizon 2017-04-06 17:16:19 +02:00
parent 3e55e07422
commit 7bcca2284b
1 changed files with 8 additions and 0 deletions

View File

@ -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