Block acces to admin

This commit is contained in:
ExostFlash 2023-11-23 11:35:50 +01:00
parent 9c58652125
commit 6c07fa278f
3 changed files with 9 additions and 6 deletions

View file

@ -31,7 +31,7 @@ security:
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
# - { path: ^/admin, roles: ROLE_ADMIN }
- { path: ^/admin, roles: ROLE_Root }
# - { path: ^/profile, roles: ROLE_USER }
when@test:

View file

@ -1,9 +1,9 @@
framework:
default_locale: en
default_locale: fr
translator:
default_path: '%kernel.project_dir%/translations'
default_path: "%kernel.project_dir%/translations"
fallbacks:
- en
- fr
# providers:
# crowdin:
# dsn: '%env(CROWDIN_DSN)%'

View file

@ -80,6 +80,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
public function getRoles(): array
{
$roles = $this->roles;
$grade = $this->grade;
$roles[] = "ROLE_" . (string)$grade;
return array_unique($roles);
}