簡體   English   中英

如何調試用戶以什么角色登錄?

[英]How can I debug what role a user is logged in as?

如何調試用戶以什么角色登錄?

我正在與前端用戶一起在Neos中制作一個插件,並希望使用視圖助手來限制對某些操作的訪問:

<f:security.ifHasRole role="Example.Something:User">

在控制器中,輸入:

/**
 * @var \TYPO3\Flow\Security\Context
 * @Flow\Inject
 */
protected $securityContext;

// In controller action
$this->securityContext->getAccount() 

在流體視圖中:

<f:debug>{account.roles}</f:debug>

暫無
暫無

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

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