Class: AssignmentPolicy

Inherits:
ApplicationPolicy show all
Defined in:
app/policies/assignment_policy.rb

Overview

Protects Assignment objects with policies.

Instance Method Summary collapse

Methods inherited from ApplicationPolicy

#initialize, #scope, #user

Constructor Details

This class inherits a constructor from ApplicationPolicy

Instance Method Details

#index?Boolean Also known as: show?, create?, new?, update?, edit?, destroy?

Returns if the user is a admin, they can work with assignments

Returns:

  • (Boolean)

    if the user is a admin, they can work with assignments



4
5
6
# File 'app/policies/assignment_policy.rb', line 4

def index?
  user.admin?
end