security - User roles in route settings -
to check if user have access controller depending on role in top of controller:
$this->denyaccessunlessgranted('role_admin');
or use annotation:
/** * @security("has_role('role_admin')") */
and protected controllers have such check.
is possible put check in route settings, e. g. way or somehow similar:
protected_route: path: /top_secret defaults: { _controller: '...', roles: [role_admin] }
?
yes should @ page:
http://symfony.com/doc/current/book/security.html#securing-url-patterns-access-control
# app/config/security.yml security: # ... firewalls: # ... access_control: # require role_admin /admin* - { path: ^/admin, roles: role_admin }
Comments
Post a Comment