Sha256: 31abc3ac68b2c3fbd5af18719935514c19cc71091bc7a66f317a6d094eddd0a0

Contents?: true

Size: 446 Bytes

Versions: 39

Compression:

Stored size: 446 Bytes

Contents

class ContentTypePolicy < ApplicationPolicy
  def index?
    true if user.try(:has_role?, 'Administrator')
  end

  def show?
    true if user.try(:has_role?, 'Administrator')
  end

  def create?
    true if user.try(:has_role?, 'Administrator')
  end

  def update?
    true if user.try(:has_role?, 'Administrator')
  end

  def destroy?
    if user.try(:has_role?, 'Administrator')
      true if record.manifestations.empty?
    end
  end
end

Version data entries

39 entries across 38 versions & 2 rubygems

Version Path
enju_biblio-0.3.18 app/policies/content_type_policy.rb
enju_biblio-0.3.17 app/policies/content_type_policy.rb
enju_biblio-0.3.16 app/policies/content_type_policy.rb
enju_biblio-0.3.15 app/policies/content_type_policy.rb
enju_biblio-0.3.14 app/policies/content_type_policy.rb
enju_biblio-0.3.13 app/policies/content_type_policy.rb
enju_biblio-0.3.12 app/policies/content_type_policy.rb
enju_biblio-0.3.11 app/policies/content_type_policy.rb
enju_biblio-0.3.10 app/policies/content_type_policy.rb
enju_biblio-0.3.10.rc.3 app/policies/content_type_policy.rb
enju_biblio-0.3.10.rc.2 app/policies/content_type_policy.rb
enju_biblio-0.3.10.rc.1 app/policies/content_type_policy.rb
enju_biblio-0.3.9 app/policies/content_type_policy.rb
enju_biblio-0.4.0.rc.1 app/policies/content_type_policy.rb
enju_biblio-0.3.8 app/policies/content_type_policy.rb
enju_biblio-0.3.7 app/policies/content_type_policy.rb
enju_biblio-0.3.6 app/policies/content_type_policy.rb
enju_biblio-0.4.0.beta.2 app/policies/content_type_policy.rb
enju_biblio-0.4.0.beta.1 app/policies/content_type_policy.rb
enju_biblio-0.3.5 app/policies/content_type_policy.rb