mirror of
https://github.com/Evolix/chexpire.git
synced 2024-06-26 19:12:53 +02:00
26 lines
274 B
Ruby
26 lines
274 B
Ruby
class CheckPolicy < ApplicationPolicy
|
|
class Scope < Scope
|
|
def resolve
|
|
scope.where(user: user)
|
|
end
|
|
end
|
|
|
|
def create?
|
|
true
|
|
end
|
|
|
|
def update?
|
|
owner?
|
|
end
|
|
|
|
def destroy?
|
|
owner?
|
|
end
|
|
|
|
private
|
|
|
|
def owner?
|
|
record.user == user
|
|
end
|
|
end
|