0

如何调试用户登录的角色?

我正在与前端用户一起在 Neos 中制作一个插件,并希望使用视图助手限制对某些操作的访问:

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

1 回答 1

0

在控制器中,编写:

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

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

在流体视图中:

<f:debug>{account.roles}</f:debug>
于 2015-04-07T14:29:10.717 回答