Skip to content

Commit faaedb4

Browse files
committed
bug #532 Support class inheritance in UserProvider::supportsClass by default (MisatoTremor)
This PR was merged into the 1.0-dev branch. Discussion ---------- Support class inheritance in UserProvider::supportsClass by default I propose to add the check if given class name is inherited from the User class (like the EntityUserProvider implementation does) to the UserProvider template. Also I would follow up with a documentation PR reflecting that change in https://github.com/symfony/symfony-docs/blob/master/security/user_provider.rst Or would it better to just add a info about this additional check to the documentation? Commits ------- fa83c95 Allow wrapper classes in supportsClass
2 parents da62909 + fa83c95 commit faaedb4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Resources/skeleton/security/UserProvider.tpl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function refreshUser(UserInterface $user)
5959
*/
6060
public function supportsClass($class)
6161
{
62-
return <?= $user_short_name ?>::class === $class;
62+
return <?= $user_short_name ?>::class === $class || is_subclass_of($class, <?= $user_short_name ?>::class);
6363
}
6464
<?php if ($password_upgrader): ?>
6565

0 commit comments

Comments
 (0)