mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-06 07:25:32 +01:00
Fixed some inspection issues.
This commit is contained in:
@@ -80,7 +80,7 @@ class UserController extends AdminPages\BaseAdminController
|
||||
*/
|
||||
public function delete(Request $request, User $entity, StructuralElementRecursionHelper $recursionHelper)
|
||||
{
|
||||
if (User::ID_ANONYMOUS == $entity->getID()) {
|
||||
if (User::ID_ANONYMOUS === $entity->getID()) {
|
||||
throw new \InvalidArgumentException('You can not delete the anonymous user! It is needed for permission checking without a logged in user');
|
||||
}
|
||||
|
||||
@@ -120,6 +120,7 @@ class UserController extends AdminPages\BaseAdminController
|
||||
//If no user id was passed, then we show info about the current user
|
||||
if (null === $user) {
|
||||
$user = $this->getUser();
|
||||
|
||||
} else {
|
||||
//Else we must check, if the current user is allowed to access $user
|
||||
$this->denyAccessUnlessGranted('read', $user);
|
||||
|
||||
Reference in New Issue
Block a user