1000 search results

237 lines | src/Entity/DragonTreasure.php
// ... lines 1 - 26
#[ApiResource(
// ... lines 28 - 29
operations: [
// ... lines 31 - 36
new Post(
security: 'is_granted("ROLE_TREASURE_CREATE")',
),
// ... lines 40 - 41
],
// ... lines 43 - 56
)]
// ... lines 58 - 75
class DragonTreasure
{
// ... lines 78 - 235
}
See Code Block in Script
245 lines | src/Entity/DragonTreasure.php
// ... lines 1 - 27
#[ApiResource(
// ... lines 29 - 30
operations: [
// ... lines 32 - 40
new Put(
security: 'is_granted("ROLE_TREASURE_EDIT")',
),
// ... lines 44 - 49
],
// ... lines 51 - 64
)]
// ... lines 66 - 83
class DragonTreasure
{
// ... lines 86 - 243
}
See Code Block in Script
245 lines | src/Entity/DragonTreasure.php
// ... lines 1 - 27
#[ApiResource(
// ... lines 29 - 30
operations: [
// ... lines 32 - 43
new Patch(
security: 'is_granted("ROLE_TREASURE_EDIT")',
),
// ... lines 47 - 49
],
// ... lines 51 - 64
)]
// ... lines 66 - 83
class DragonTreasure
{
// ... lines 86 - 243
}
See Code Block in Script
245 lines | src/Entity/DragonTreasure.php
// ... lines 1 - 27
#[ApiResource(
// ... lines 29 - 30
operations: [
// ... lines 32 - 46
new Delete(
security: 'is_granted("ROLE_ADMIN")',
),
],
// ... lines 51 - 64
)]
// ... lines 66 - 83
class DragonTreasure
{
// ... lines 86 - 243
}
See Code Block in Script
20 lines | src/Controller/SecurityController.php
// ... lines 1 - 7
use Symfony\Component\Security\Http\Attribute\CurrentUser;
class SecurityController extends AbstractController
{
#[Route('/login', name: 'app_login', methods: ['POST'])]
public function login(#[CurrentUser] $user = null): Response
{
// ... lines 15 - 17
}
}
See Code Block in Script
How do I download security checker when flex.symfony.com does not exist anymore and the security checker GitHub is read-only?
// ... lines 1 - 8
use Symfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationException;
// ... lines 10 - 12
class CheckVerifiedUserSubscriber implements EventSubscriberInterface
{
public function onCheckPassport(CheckPassportEvent $event)
// ... lines 16 - 26
if (!$user->getIsVerified()) {
throw new CustomUserMessageAuthenticationException(
'Please verify your account before logging in.'
);
}
}
// ... lines 33 - 39
}
See Code Block in Script
// ... lines 1 - 5
use App\Security\AccountNotVerifiedAuthenticationException;
// ... lines 7 - 13
class CheckVerifiedUserSubscriber implements EventSubscriberInterface
{
public function onCheckPassport(CheckPassportEvent $event)
{
// ... lines 18 - 27
if (!$user->getIsVerified()) {
throw new AccountNotVerifiedAuthenticationException();
}
}
// ... lines 32 - 38
}
See Code Block in Script
// ... lines 1 - 12
use Symfony\Component\Security\Http\Event\LoginFailureEvent;
class CheckVerifiedUserSubscriber implements EventSubscriberInterface
{
// ... lines 17 - 38
public static function getSubscribedEvents()
{
return [
// ... line 42
LoginFailureEvent::class => 'onLoginFailure',
];
}
}
See Code Block in Script
// ... lines 1 - 12
use Symfony\Component\Security\Http\Event\LoginFailureEvent;
class CheckVerifiedUserSubscriber implements EventSubscriberInterface
{
// ... lines 17 - 33
public function onLoginFailure(LoginFailureEvent $event)
{
dd($event);
}
// ... lines 38 - 45
}
See Code Block in Script
50 lines | src/Controller/SecurityController.php
// ... lines 1 - 4
use Doctrine\ORM\EntityManagerInterface;
use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Totp\TotpAuthenticatorInterface;
// ... lines 7 - 12
class SecurityController extends BaseController
{
// ... lines 15 - 37
public function enable2fa(TotpAuthenticatorInterface $totpAuthenticator, EntityManagerInterface $entityManager)
{
// ... lines 40 - 47
}
}
See Code Block in Script
40 lines | src/Repository/UserRepository.php
// ... lines 1 - 8
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
// ... lines 10 - 18
class UserRepository extends ServiceEntityRepository implements PasswordUpgraderInterface
{
// ... lines 21 - 28
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void
{
// ... lines 31 - 37
}
}
See Code Block in Script
213 lines | src/Entity/User.php
// ... lines 1 - 8
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
// ... lines 10 - 14
class User implements UserInterface, PasswordAuthenticatedUserInterface
{
// ... lines 17 - 211
}
See Code Block in Script
// ... lines 1 - 5
use Symfony\Component\Security\Http\Event\CheckPassportEvent;
class CheckVerifiedUserSubscriber implements EventSubscriberInterface
{
// ... lines 10 - 14
public static function getSubscribedEvents()
{
return [
CheckPassportEvent::class => 'onCheckPassport',
];
}
}
See Code Block in Script
// ... lines 1 - 5
use Symfony\Component\Security\Http\Event\CheckPassportEvent;
class CheckVerifiedUserSubscriber implements EventSubscriberInterface
{
public function onCheckPassport(CheckPassportEvent $event)
{
dd($event);
}
// ... lines 14 - 20
}
See Code Block in Script
// ... lines 1 - 6
use Symfony\Component\Security\Http\Authenticator\Passport\UserPassportInterface;
// ... lines 8 - 9
class CheckVerifiedUserSubscriber implements EventSubscriberInterface
{
public function onCheckPassport(CheckPassportEvent $event)
{
$passport = $event->getPassport();
if (!$passport instanceof UserPassportInterface) {
throw new \Exception('Unexpected passport type');
}
}
// ... lines 19 - 25
}
See Code Block in Script
// ... lines 1 - 7
use Symfony\Component\Security\Core\Exception\AuthenticationException;
// ... lines 9 - 11
class CheckVerifiedUserSubscriber implements EventSubscriberInterface
{
public function onCheckPassport(CheckPassportEvent $event)
{
// ... lines 16 - 25
if (!$user->getIsVerified()) {
throw new AuthenticationException();
}
}
// ... lines 30 - 36
}
See Code Block in Script
// ... lines 1 - 8
use Symfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationException;
// ... lines 10 - 12
class CheckVerifiedUserSubscriber implements EventSubscriberInterface
{
public function onCheckPassport(CheckPassportEvent $event)
// ... lines 16 - 26
if (!$user->getIsVerified()) {
throw new CustomUserMessageAuthenticationException(
'Please verify your account before logging in.'
);
}
}
// ... lines 33 - 39
}
See Code Block in Script
// ... lines 1 - 6
use Symfony\Component\Security\Core\Security;
// ... line 8
class BlameableSubscriber implements EventSubscriberInterface
{
private Security $security;
public function __construct(Security $security)
{
$this->security = $security;
}
// ... lines 17 - 28
}
See Code Block in Script
Hey Trafficmanagertech Inside your `security.yaml` file do you have a "main" key defined as your firewall? Cheers!
MolloKhan
MolloKhan
Read Full Comment