Sha256: 8aa81e303bd385be0d4dc61a0f41695e44dd5619d41c4ac6c3ac34cc01930817

Contents?: true

Size: 480 Bytes

Versions: 5

Compression:

Stored size: 480 Bytes

Contents

module Locomotive
  class ContentTypePolicy < ApplicationPolicy

    def index?
      site_staff?
    end

    def create?
      site_admin_or_designer?
    end

    def update?
      site_admin_or_designer?
    end

    def destroy?
      site_admin_or_designer?
    end

    def destroy_all?
      site_admin_or_designer?
    end

    def show?
      site_admin_or_designer? || !@resource.hidden?
    end

    def import?
      @resource.import_enabled?      
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
locomotivecms-4.2.0.alpha2 app/policies/locomotive/content_type_policy.rb
locomotivecms-4.2.0.alpha1 app/policies/locomotive/content_type_policy.rb
locomotivecms-4.1.1 app/policies/locomotive/content_type_policy.rb
locomotivecms-4.1.0 app/policies/locomotive/content_type_policy.rb
locomotivecms-4.1.0.rc1 app/policies/locomotive/content_type_policy.rb