Sha256: 5e769c56b07bcce673675a5f84f28d5306c4289c904dbc53a7d03f7abc62696e

Contents?: true

Size: 448 Bytes

Versions: 17

Compression:

Stored size: 448 Bytes

Contents

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

  def show?
    true if user.try(:has_role?, 'Librarian')
  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.shelves.empty? && !record.web?
    end
  end
end

Version data entries

17 entries across 15 versions & 2 rubygems

Version Path
enju_library-0.2.3 app/policies/library_group_policy.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_library-0.2.2/app/policies/library_group_policy.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_library-0.2.1/app/policies/library_group_policy.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/bundler/gems/enju_library-d36f415e177e/app/policies/library_group_policy.rb
enju_library-0.2.2 app/policies/library_group_policy.rb
enju_library-0.2.1 app/policies/library_group_policy.rb
enju_library-0.2.0 app/policies/library_group_policy.rb
enju_library-0.2.0.beta.10 app/policies/library_group_policy.rb
enju_library-0.2.0.beta.9 app/policies/library_group_policy.rb
enju_library-0.2.0.beta.8 app/policies/library_group_policy.rb
enju_library-0.2.0.beta.7 app/policies/library_group_policy.rb
enju_library-0.2.0.beta.6 app/policies/library_group_policy.rb
enju_library-0.2.0.beta.5 app/policies/library_group_policy.rb
enju_library-0.2.0.beta.4 app/policies/library_group_policy.rb
enju_library-0.2.0.beta.3 app/policies/library_group_policy.rb
enju_library-0.2.0.beta.2 app/policies/library_group_policy.rb
enju_library-0.2.0.beta.1 app/policies/library_group_policy.rb