2015-03-12 22:43:13 +00:00
|
|
|
class ProductPolicy < ApplicationPolicy
|
|
|
|
|
2015-03-18 22:02:38 +00:00
|
|
|
def index?
|
|
|
|
record.platform.main?
|
|
|
|
end
|
|
|
|
|
|
|
|
def show?
|
2015-03-25 00:17:17 +00:00
|
|
|
PlatformPolicy.new(user, record.platform).show?
|
2015-03-18 22:02:38 +00:00
|
|
|
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
|