Sha256: 1d633d4a891c17402777518aebc83c18a04fd0554abe629a3d43b490cf301327

Contents?: true

Size: 305 Bytes

Versions: 34

Compression:

Stored size: 305 Bytes

Contents

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

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

  def create?
    false
  end

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

  def destroy?
    false
  end
end

Version data entries

34 entries across 33 versions & 2 rubygems

Version Path
enju_seed-0.3.6 app/policies/role_policy.rb
enju_seed-0.3.5 app/policies/role_policy.rb
enju_seed-0.4.0.rc.2 app/policies/role_policy.rb
enju_seed-0.3.4 app/policies/role_policy.rb
enju_seed-0.4.0.rc.1 app/policies/role_policy.rb
enju_seed-0.4.0.beta.3 app/policies/role_policy.rb
enju_seed-0.5.0.beta.1 app/policies/role_policy.rb
enju_seed-0.4.0.beta.2 app/policies/role_policy.rb
enju_seed-0.3.3 app/policies/role_policy.rb
enju_seed-0.3.2 app/policies/role_policy.rb
enju_seed-0.3.1 app/policies/role_policy.rb
enju_seed-0.3.0 app/policies/role_policy.rb
enju_seed-0.3.0.rc.1 app/policies/role_policy.rb
enju_seed-0.3.0.beta.7 app/policies/role_policy.rb
enju_seed-0.4.0.beta.1 app/policies/role_policy.rb
enju_seed-0.3.0.beta.6 app/policies/role_policy.rb
enju_seed-0.2.3 app/policies/role_policy.rb
enju_seed-0.3.0.beta.4 app/policies/role_policy.rb
enju_seed-0.2.2 app/policies/role_policy.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_seed-0.2.0/app/policies/role_policy.rb