Class: EmployeeTimesheetPolicy

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

Constant Summary

Constants inherited from ApplicationPolicy

ApplicationPolicy::VALID_DISPLAYS

Instance Method Summary collapse

Methods inherited from ApplicationPolicy

#to_h

Constructor Details

#initialize(user, timesheet) ⇒ EmployeeTimesheetPolicy

Returns a new instance of EmployeeTimesheetPolicy.



2
3
4
5
6
# File 'app/policies/employee_timesheet_policy.rb', line 2

def initialize(user, timesheet)
  @user = user
  @timesheet = timesheet
  super()
end

Instance Method Details

#authorize_create!Object



8
9
10
# File 'app/policies/employee_timesheet_policy.rb', line 8

def authorize_create!
  authorize_write!
end

#authorize_update!Object



12
13
14
# File 'app/policies/employee_timesheet_policy.rb', line 12

def authorize_update!
  authorize_write!
end