mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 02:09:03 +02:00
Fixed missing invalidation of user tree views.
This commit is contained in:
parent
3a081b6413
commit
fc8ab93752
2 changed files with 3 additions and 1 deletions
|
@ -82,6 +82,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
|
||||
* @ORM\Table("`users`")
|
||||
* @ORM\EntityListeners({"App\EntityListeners\TreeCacheInvalidationListener"})
|
||||
* @UniqueEntity("name", message="validator.user.username_already_used")
|
||||
*/
|
||||
class User extends AttachmentContainingDBElement implements UserInterface, HasPermissionsInterface, TwoFactorInterface, BackupCodeInterface, TrustedDeviceInterface, U2FTwoFactorInterface, PreferredProviderInterface
|
||||
|
|
|
@ -60,8 +60,9 @@ class TreeCacheInvalidationListener
|
|||
|
||||
//If a user change, then invalidate all cached trees for him
|
||||
if ($element instanceof User) {
|
||||
$secure_class_name = str_replace('\\', '_', get_class($element));
|
||||
$tag = $this->keyGenerator->generateKey($element);
|
||||
$this->cache->invalidateTags([$tag]);
|
||||
$this->cache->invalidateTags([$tag, $secure_class_name]);
|
||||
}
|
||||
|
||||
/* If any group change, then invalidate all cached trees. Users Permissions can be inherited from groups,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue