Class: UseRestrictionPolicy

Inherits:
ApplicationPolicy
  • Object
show all
Defined in:
app/policies/use_restriction_policy.rb

Instance Method Summary collapse

Instance Method Details

#create?Boolean



10
11
12
# File 'app/policies/use_restriction_policy.rb', line 10

def create?
  false
end

#destroy?Boolean



20
21
22
# File 'app/policies/use_restriction_policy.rb', line 20

def destroy?
  false
end

#index?Boolean



2
3
4
# File 'app/policies/use_restriction_policy.rb', line 2

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

#show?Boolean



6
7
8
# File 'app/policies/use_restriction_policy.rb', line 6

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

#update?Boolean



14
15
16
17
18
# File 'app/policies/use_restriction_policy.rb', line 14

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