mirror of
https://github.com/Evolix/chexpire.git
synced 2024-06-17 23:07:18 +02:00
29 lines
417 B
Ruby
29 lines
417 B
Ruby
# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Evolix <info@evolix.fr>
|
|
# License: GNU AGPL-3+ (see full text in LICENSE file)
|
|
|
|
class NotificationPolicy < 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
|