mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-04 14:35:49 +01:00
Forbid to delete the anonymous user.
This commit is contained in:
@@ -89,6 +89,9 @@ class UserController extends AdminPages\BaseAdminController
|
||||
*/
|
||||
public function delete(Request $request, User $entity, StructuralElementRecursionHelper $recursionHelper)
|
||||
{
|
||||
if ($entity->getID() == User::ID_ANONYMOUS) {
|
||||
throw new \InvalidArgumentException('You can not delete the anonymous user! It is needed for permission checking without a logged in user');
|
||||
}
|
||||
return $this->_delete($request, $entity, $recursionHelper);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user