minimaloriginal / security-bundle
The security bundle for Minimal
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Language:HTML
Type:symfony-bundle
Requires
- php: >=5.5.9
- friendsofsymfony/user-bundle: ~2.0
- minimaloriginal/core-bundle: dev-master
- symfony/symfony: 3.3.*
This package is not auto-updated.
Last update: 2025-03-02 07:30:42 UTC
README
The security bundle for Minimal
Command to launch
bin/console fos:user:create testuser test@example.com p@ssword --super-admin
Register bundle
$bundles = [ ... new FOS\UserBundle\FOSUserBundle(), new MinimalOriginal\SecurityBundle\MinimalSecurityBundle(), ];
Register routes
minimal_security: resource: "@MinimalSecurityBundle/Resources/config/routing.yml" prefix: /
Security configuration
security: encoders: MinimalOriginal\SecurityBundle\Entity\User: bcrypt
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: ROLE_ADMIN
providers:
minimal_security:
id: fos_user.user_provider.username_email
firewalls:
main:
pattern: ^/
form_login:
provider: minimal_security
csrf_token_generator: security.csrf.token_manager
# if you are using Symfony < 2.8, use the following config instead:
# csrf_provider: form.csrf_provider
logout: true
anonymous: true
access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/, role: ROLE_USER }