only instructeurs of the avis dossier or claimant can revive expert

This commit is contained in:
Christophe Robillard 2020-07-21 13:14:07 +02:00
parent 169b8c9b3e
commit 7f90bdeec4
2 changed files with 13 additions and 7 deletions

View file

@ -60,6 +60,10 @@ class Avis < ApplicationRecord
revoked_at.present?
end
def revivable_by?(reviver)
revokable_by?(reviver)
end
def revokable_by?(revocator)
revocator.dossiers.include?(dossier) || revocator == claimant
end