ninefolio/config/packages/security.yaml

41 lines
831 B
YAML
Raw Normal View History

2024-09-17 14:02:17 +02:00
security:
2024-10-29 16:54:40 +01:00
encoders:
App\Entity\User:
id: app.password.encoder
role_hierarchy:
ROLE_USER:
ROLE_ADMIN:
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
pattern: ^/
anonymous: true
provider: main
form_login:
login_path: app_login
check_path: app_login
default_target_path: app_home
use_referer: true
csrf_parameter: _csrf_security_token
csrf_token_id: a_private_string
logout:
invalidate_session: true
path: app_logout
target: app_home
providers:
main:
entity:
class: App\Entity\User
property: username
access_control:
- { path: ^/user, roles: [ROLE_ADMIN, ROLE_USER] }
- { path: ^/admin, roles: [ROLE_ADMIN] }