2015-03-18 22:02:38 +00:00
|
|
|
class MassBuildPolicy < ApplicationPolicy
|
|
|
|
|
|
|
|
def show?
|
2015-03-25 00:17:17 +00:00
|
|
|
ProjectPolicy.new(user, record.save_to_platform).show?
|
2015-03-18 22:02:38 +00:00
|
|
|
end
|
|
|
|
alias_method :read?, :show?
|
|
|
|
alias_method :get_list?, :show?
|
|
|
|
|
|
|
|
def create?
|
|
|
|
owner?(record.save_to_platform) || local_admin?(record.save_to_platform)
|
|
|
|
end
|
|
|
|
alias_method :publish?, :create?
|
|
|
|
|
|
|
|
def cancel?
|
|
|
|
!record.stop_build && create?
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|