Sha256: 96c7dfe7ffbdb47cd7ab87daace99636256721ff91a78139fc2e222d1d02db5a

Contents?: true

Size: 391 Bytes

Versions: 68

Compression:

Stored size: 391 Bytes

Contents

class ItemPolicy < ApplicationPolicy
  def index?
    true
  end

  def show?
    true
  end

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

  def edit?
    true if user.try(:has_role?, 'Librarian')
  end

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

  def destroy?
    if user.try(:has_role?, 'Librarian')
      record.removable?
    end
  end
end

Version data entries

68 entries across 67 versions & 3 rubygems

Version Path
enju_biblio-0.3.18 app/policies/item_policy.rb
enju_biblio-0.3.17 app/policies/item_policy.rb
enju_biblio-0.3.16 app/policies/item_policy.rb
enju_circulation-0.3.11 app/policies/item_policy.rb
enju_biblio-0.3.15 app/policies/item_policy.rb
enju_circulation-0.3.10 app/policies/item_policy.rb
enju_biblio-0.3.14 app/policies/item_policy.rb
enju_biblio-0.3.13 app/policies/item_policy.rb
enju_circulation-0.3.9 app/policies/item_policy.rb
enju_biblio-0.3.12 app/policies/item_policy.rb
enju_biblio-0.3.11 app/policies/item_policy.rb
enju_biblio-0.3.10 app/policies/item_policy.rb
enju_biblio-0.3.10.rc.3 app/policies/item_policy.rb
enju_biblio-0.3.10.rc.2 app/policies/item_policy.rb
enju_biblio-0.3.10.rc.1 app/policies/item_policy.rb
enju_biblio-0.3.9 app/policies/item_policy.rb
enju_circulation-0.4.0.rc.1 app/policies/item_policy.rb
enju_biblio-0.4.0.rc.1 app/policies/item_policy.rb
enju_circulation-0.3.8 app/policies/item_policy.rb
enju_biblio-0.3.8 app/policies/item_policy.rb