rosa-build/app/policies/product_policy.rb

20 lines
386 B
Ruby
Raw Normal View History

2015-03-12 22:43:13 +00:00
class ProductPolicy < ApplicationPolicy
def index?
record.platform.main?
end
def show?
PlatformPolicy.new(user, record.platform).show?
end
alias_method :read?, :show?
def create?
record.platform.main? && local_admin?(record.platform)
end
alias_method :clone?, :create?
alias_method :destroy?, :create?
alias_method :update?, :create?
2015-03-12 22:43:13 +00:00
end