diff --git a/src/Security/Voter/SnipVoter.php b/src/Security/Voter/SnipVoter.php index 012d158..56b8f44 100644 --- a/src/Security/Voter/SnipVoter.php +++ b/src/Security/Voter/SnipVoter.php @@ -25,9 +25,6 @@ class SnipVoter extends Voter /** @var Snip $subject */ $user = $token->getUser(); - if (!$user instanceof UserInterface) { - return false; - } switch ($attribute) { case self::VIEW: @@ -35,6 +32,9 @@ class SnipVoter extends Voter return true; } case self::EDIT: + if (!$user instanceof UserInterface) { + return false; + } if ($subject->getCreatedBy() === $user) { return true; }