servercontrol/config/packages/security.yaml

55 lines
1.7 KiB
YAML

security:
password_hashers:
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
providers:
app_user_provider:
entity:
class: App\Entity\User
property: email
firewalls:
dev:
pattern: ^/(_profiler|_wdt|assets|build)/
security: false
main:
lazy: true
provider: app_user_provider
user_checker: App\Security\UserChecker
form_login:
login_path: app_login
check_path: app_login
enable_csrf: true
default_target_path: /
logout:
path: app_logout
target: app_login
remember_me:
secret: '%kernel.secret%'
lifetime: 604800
access_denied_handler: App\Security\AccessDeniedHandler
access_control:
- { path: ^/login, roles: PUBLIC_ACCESS }
- { path: ^/logout, roles: PUBLIC_ACCESS }
- { path: ^/register, roles: PUBLIC_ACCESS }
- { path: ^/forgot-password, roles: PUBLIC_ACCESS }
- { path: ^/reset-password, roles: PUBLIC_ACCESS }
- { path: ^/profile, roles: ROLE_OPERATOR }
- { path: ^/pending, roles: ROLE_USER }
- { path: ^/$, roles: ROLE_USER }
- { path: ^/admin, roles: ROLE_ADMIN }
- { path: ^/, roles: ROLE_OPERATOR }
role_hierarchy:
ROLE_OPERATOR: ROLE_USER
ROLE_ADMIN: ROLE_OPERATOR
when@test:
security:
password_hashers:
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
algorithm: auto
cost: 4
time_cost: 3
memory_cost: 10