mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-28 04:30:08 +02:00
Merge branch 'master' into log_detail_page
This commit is contained in:
commit
4c6ceab8e8
291 changed files with 1994 additions and 1621 deletions
|
@ -37,7 +37,7 @@ class EnsureSAMLUserForSAMLLoginChecker implements EventSubscriberInterface
|
|||
$this->translator = $translator;
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
AuthenticationSuccessEvent::class => 'onAuthenticationSuccess',
|
||||
|
|
|
@ -25,7 +25,6 @@ namespace App\Security;
|
|||
use App\Entity\UserSystem\User;
|
||||
use Symfony\Component\Security\Core\Exception\AccountStatusException;
|
||||
use Symfony\Component\Security\Core\Exception\CustomUserMessageAccountStatusException;
|
||||
use Symfony\Component\Security\Core\Exception\DisabledException;
|
||||
use Symfony\Component\Security\Core\User\UserCheckerInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
@ -60,7 +59,7 @@ final class UserChecker implements UserCheckerInterface
|
|||
return;
|
||||
}
|
||||
|
||||
//Check if user is disabled. Then dont allow login
|
||||
//Check if user is disabled. Then don't allow login
|
||||
if ($user->isDisabled()) {
|
||||
//throw new DisabledException();
|
||||
throw new CustomUserMessageAccountStatusException($this->translator->trans('user.login_error.user_disabled', [], 'security'));
|
||||
|
|
|
@ -32,7 +32,7 @@ use function in_array;
|
|||
|
||||
class AttachmentVoter extends ExtendedVoter
|
||||
{
|
||||
protected $security;
|
||||
protected Security $security;
|
||||
|
||||
public function __construct(PermissionManager $resolver, EntityManagerInterface $entityManager, Security $security)
|
||||
{
|
||||
|
|
|
@ -118,7 +118,7 @@ class ParameterVoter extends ExtendedVoter
|
|||
return $this->resolver->inherit($user, $param, $attribute) ?? false;
|
||||
}
|
||||
|
||||
protected function supports(string $attribute, $subject)
|
||||
protected function supports(string $attribute, $subject): bool
|
||||
{
|
||||
if (is_a($subject, AbstractParameter::class, true)) {
|
||||
//These are the allowed attributes
|
||||
|
|
|
@ -69,7 +69,7 @@ class StructureVoter extends ExtendedVoter
|
|||
}
|
||||
|
||||
/**
|
||||
* Maps a instance type to the permission name.
|
||||
* Maps an instance type to the permission name.
|
||||
*
|
||||
* @param object|string $subject The subject for which the permission name should be generated
|
||||
*
|
||||
|
|
|
@ -80,7 +80,7 @@ class UserVoter extends ExtendedVoter
|
|||
}
|
||||
}
|
||||
|
||||
//Else just check users permission:
|
||||
//Else just check user permission:
|
||||
if ($this->resolver->isValidOperation('users', $attribute)) {
|
||||
return $this->resolver->inherit($user, 'users', $attribute) ?? false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue