Block acces to admin
This commit is contained in:
parent
9c58652125
commit
6c07fa278f
3 changed files with 9 additions and 6 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
framework:
|
||||
default_locale: en
|
||||
translator:
|
||||
default_path: '%kernel.project_dir%/translations'
|
||||
fallbacks:
|
||||
- en
|
||||
default_locale: fr
|
||||
translator:
|
||||
default_path: "%kernel.project_dir%/translations"
|
||||
fallbacks:
|
||||
- fr
|
||||
# providers:
|
||||
# crowdin:
|
||||
# dsn: '%env(CROWDIN_DSN)%'
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue