21
1
Fork 0
mirror of https://github.com/Evolix/chexpire.git synced 2024-05-09 12:08:38 +02:00
chexpire/app/policies/check_policy.rb

33 lines
442 B
Ruby
Raw Normal View History

# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Evolix <info@evolix.fr>
# License: GNU AGPL-3+ (see full text in LICENSE file)
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
def supports?
new?
end
private
def owner?
record.user == user
end
end