mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 18:28:49 +02:00
Show special icon in users menu when a user is locked
This commit is contained in:
parent
a3aa8ec2ef
commit
37fde77b8e
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue