我找不到這個特定的任何東西;Symfony2 - 檢查用戶是否具有身份驗證角色
我需要一個簡單的檢查,當用戶登錄在前端,如果該用戶已經例如角色:ROLE_CUSTOMER
我需要這將在authenticationprocess完成的,因爲它必須返回一個錯誤,如果用戶不要有這個角色。
Security.yml
public:
pattern: ^/
context: site
form_login:
provider: fos_userbundle
csrf_provider: form.csrf_provider
check_path: site_login_check
login_path: site_login
success_handler: authentication_handler
failure_handler: authentication_handler
logout:
path: site_logout
target: site_login
anonymous: true
您使用什麼登錄方式? [文檔中的方法](http://symfony.com/doc/current/cookbook/security/entity_provider.html)? –
我使用FOSuserbundle – Chris