[英]Symfony 2/3 : Check user against a firewall behind any url
I've been looking for a solution to this problem for weeks. 数周以来,我一直在寻找解决方案。
Let's say i have two firewalls : 假设我有两个防火墙:
The two firewalls are using different providers so an admin is not an instance of customer which means that an identified user can be an admin or a customer. 这两个防火墙使用的是不同的提供程序,因此管理员不是客户的实例,这意味着所标识的用户可以是管理员或客户。
I'd like, on the front office (not in /admin), to provide special functionality a logged in admin but the AuthorizationChecker and the RequestMatcher are not working since they want an url that match /admin. 我想在前端办公室(不在/ admin中)提供特殊功能(已登录的admin),但是AuthorizationChecker和RequestMatcher无法正常工作,因为它们想要与/ admin匹配的网址。
I need to have 2 different firewall and providers since i want my users to be able to log in as an admin or as a customer. 我需要2个不同的防火墙和提供程序,因为我希望我的用户能够以管理员或客户身份登录。
您应该使用角色,而不是2个不同的防火墙
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.