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
|
# Easy way to control access for large sections of your site
|
||||||
# Note: Only the *first* access control that matches will be used
|
# Note: Only the *first* access control that matches will be used
|
||||||
access_control:
|
access_control:
|
||||||
# - { path: ^/admin, roles: ROLE_ADMIN }
|
- { path: ^/admin, roles: ROLE_Root }
|
||||||
# - { path: ^/profile, roles: ROLE_USER }
|
# - { path: ^/profile, roles: ROLE_USER }
|
||||||
|
|
||||||
when@test:
|
when@test:
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
framework:
|
framework:
|
||||||
default_locale: en
|
default_locale: fr
|
||||||
translator:
|
translator:
|
||||||
default_path: '%kernel.project_dir%/translations'
|
default_path: "%kernel.project_dir%/translations"
|
||||||
fallbacks:
|
fallbacks:
|
||||||
- en
|
- fr
|
||||||
# providers:
|
# providers:
|
||||||
# crowdin:
|
# crowdin:
|
||||||
# dsn: '%env(CROWDIN_DSN)%'
|
# dsn: '%env(CROWDIN_DSN)%'
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||||
public function getRoles(): array
|
public function getRoles(): array
|
||||||
{
|
{
|
||||||
$roles = $this->roles;
|
$roles = $this->roles;
|
||||||
|
$grade = $this->grade;
|
||||||
|
|
||||||
|
$roles[] = "ROLE_" . (string)$grade;
|
||||||
|
|
||||||
return array_unique($roles);
|
return array_unique($roles);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue