Initial install of action policy

This commit is contained in:
2024-09-12 12:41:38 +02:00
parent 74038c0615
commit 64289d045d
5 changed files with 61 additions and 4 deletions

View File

@@ -0,0 +1,20 @@
class JobPolicy < ApplicationPolicy
# See https://actionpolicy.evilmartians.io/#/writing_policies
#
# def index?
# true
# end
#
# def update?
# # here we can access our context and record
# user.admin? || (user.id == record.user_id)
# end
# Scoping
# See https://actionpolicy.evilmartians.io/#/scoping
#
# relation_scope do |relation|
# next relation if user.admin?
# relation.where(user: user)
# end
end