Class: Locomotive::ContentAssetPolicy

Inherits:
ApplicationPolicy show all
Defined in:
app/policies/locomotive/content_asset_policy.rb

Instance Attribute Summary

Attributes inherited from ApplicationPolicy

#membership, #resource

Instance Method Summary collapse

Methods inherited from ApplicationPolicy

#destroy_all?, #initialize, #persisted?, #show?, #site_admin?, #site_admin_or_designer?, #site_staff?, #super_admin?

Constructor Details

This class inherits a constructor from Locomotive::ApplicationPolicy

Instance Method Details

#create?Boolean

Returns:


16
17
18
# File 'app/policies/locomotive/content_asset_policy.rb', line 16

def create?
  site_staff? && !membership.visitor?
end

#destroy?Boolean

Returns:


24
25
26
# File 'app/policies/locomotive/content_asset_policy.rb', line 24

def destroy?
  site_staff? && !membership.visitor?
end

#edit?Boolean

Returns:


12
13
14
# File 'app/policies/locomotive/content_asset_policy.rb', line 12

def edit?
  site_staff?
end

#index?Boolean

Returns:


4
5
6
# File 'app/policies/locomotive/content_asset_policy.rb', line 4

def index?
  site_staff?
end

#new?Boolean

Returns:


8
9
10
# File 'app/policies/locomotive/content_asset_policy.rb', line 8

def new?
  site_staff?
end

#update?Boolean

Returns:


20
21
22
# File 'app/policies/locomotive/content_asset_policy.rb', line 20

def update?
  site_staff? && !membership.visitor?
end