【问题标题】:Show Symfony profiler only for admins仅为管理员显示 Symfony 分析器
【发布时间】:2016-05-31 16:49:22
【问题描述】:

我想仅为页面管理员 (ROLE_SUPER_ADMIN) 显示 Symfony 分析器栏(以及对分析器的访问)。

我已遵循以下说明:http://symfony.com/doc/2.8/cookbook/profiler/matchers.html#creating-a-custom-matcher

但是那里不起作用。我收到此错误消息:

AuthenticationCredentialsNotFoundException in classes.php line 2892:
The token storage contains no authentication token. One possible reason may be that there is no firewall configured for this URL.

谁能帮助我,或者知道这个错误信息吗?

感谢您以后的所有回复!

【问题讨论】:

  • 你能分享一下 security.yml 文件吗?看来问题出在那儿了
  • 感谢您的回复!这是一个 pastebin:pastebin.com/jJBFixkJ 我已经找到了问题。以下行需要取消注释:firewall: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false

标签: php symfony


【解决方案1】:

确保security.yaml 中的dev 部分具有正确的参数。

确保取消注释 security.yaml 中的以下行:

firewalls:
    dev:
        pattern: ^/(_(profiler|wdt)|css|images|js)/
        security: false

在那之后它应该可以正常工作了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-09-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-10
    • 2023-03-12
    • 1970-01-01
    • 2011-06-22
    相关资源
    最近更新 更多