Added acces rules for jobs, operator/jobs and admin/dashboard view, including lazy loading for cancel button in broadcasts
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
class JobPolicy < ApplicationPolicy
|
||||
skip_pre_check :allow_admins, only: :cancel?
|
||||
|
||||
def cancel?
|
||||
record.open? && (user == record.costumer || user.operator? || user.admin?)
|
||||
end
|
||||
|
||||
# See https://actionpolicy.evilmartians.io/#/writing_policies
|
||||
#
|
||||
# def index?
|
||||
# true
|
||||
# end
|
||||
#
|
||||
# def update?
|
||||
# # here we can access our context and record
|
||||
|
||||
Reference in New Issue
Block a user