簡體   English   中英

僅為管理員顯示Symfony探查器

[英]Show Symfony profiler only for admins

我想僅為頁面管理員(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.yamldev部分具有正確的參數。

確保取消注釋security.yaml的以下行:

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

在那之后它應該工作正常。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM