2016-08-16 15:05:44 -04:00
|
|
|
module Ci
|
|
|
|
class BuildPolicy < CommitStatusPolicy
|
|
|
|
def rules
|
|
|
|
super
|
|
|
|
|
|
|
|
# If we can't read build we should also not have that
|
|
|
|
# ability when looking at this in context of commit_status
|
2016-10-21 06:16:39 -04:00
|
|
|
%w[read create update admin].each do |rule|
|
2016-08-16 15:05:44 -04:00
|
|
|
cannot! :"#{rule}_commit_status" unless can? :"#{rule}_build"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|