ninefolio/config/packages/security.yaml

47 lines
1.2 KiB
YAML
Raw Normal View History

2024-09-17 14:02:17 +02:00
security:
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_MODO, ROLE_MASTER, ROLE_USER] }
- { path: ^/master, roles: [ROLE_ADMIN, ROLE_MODO, ROLE_MASTER] }
- { path: ^/modo, roles: [ROLE_ADMIN, ROLE_MODO] }
- { path: ^/admin, roles: [ROLE_ADMIN] }