mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-03 22:15:36 +01:00
Show special icon in users menu when a user is locked
This commit is contained in:
@@ -43,6 +43,7 @@ declare(strict_types=1);
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Base\AbstractNamedDBElement;
|
||||
use App\Entity\UserSystem\User;
|
||||
use App\Helpers\Trees\TreeViewNode;
|
||||
|
||||
class NamedDBElementRepository extends DBElementRepository
|
||||
@@ -63,6 +64,11 @@ class NamedDBElementRepository extends DBElementRepository
|
||||
$node = new TreeViewNode($entity->getName(), null, null);
|
||||
$node->setId($entity->getID());
|
||||
$result[] = $node;
|
||||
|
||||
if ($entity instanceof User && $entity->isDisabled()) {
|
||||
//If this is an user, then add a badge when it is disabled
|
||||
$node->setIcon('fa-fw fa-treeview fa-solid fa-user-lock text-muted');
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
Reference in New Issue
Block a user