Skip to content
This repository was archived by the owner on Apr 3, 2023. It is now read-only.

Commit 24b608c

Browse files
author
Teddy Roncin
committed
🐛 (GroupAdminVoter) Added a check for the type of $subject in the supports method
1 parent 2f8778d commit 24b608c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Security/Voter/GroupAdminVoter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ public function __construct(Security $security)
2929
protected function supports($attribute, $subject): bool
3030
{
3131
$supportsAttribute = 'ROLE_ADMIN' === $attribute;
32+
$supportsSubject = $subject instanceof Group;
3233

33-
return $supportsAttribute;
34+
return $supportsAttribute && $supportsSubject;
3435
}
3536

3637
/**

0 commit comments

Comments
 (0)