gpt4 book ai didi

typo3 - 如何部分设置 VHS 的 AllowViewHelper 中的 FrontendUserGroup?

转载 作者:行者123 更新时间:2023-12-02 15:27:06 25 4
gpt4 key购买 nike

我想在 AllowViewHelper 中设置 frontendUserGroup 参数但我不知道该怎么做。

有时(即使我刷新缓存也不确定)会弹出此错误:

The argument "frontendUserGroup" was registered with type "TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup", but is of type "string" in view helper "FluidTYPO3\Vhs\ViewHelpers\Security\AllowViewHelper"

将用户组的引用作为参数传递如下是否正确?:

{namespace v=FluidTYPO3\Vhs\ViewHelpers}
...
<v:security.allow frontendUserGroup="3">
<f:then>
<span>Access granted</span>
</f:then>
<f:else>
<span>Access denied</span>
</f:else>
</v:security.allow>

参数由ViewHelper注册如下:

$this->registerArgument('frontendUserGroup', 'TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup', 'The FrontendUserGroup to allow/deny');

最佳答案

根据您的示例,您可能只使用 CMS Fluid 附带的 security.hasRole ViewHelper:

<f:security.ifHasRole role="3">
<f:then>
<span>Access granted</span>
</f:then>
<f:else>
<span>Access denied</span>
</f:else>
</f:security.ifHasRole>

与来自 EXT:vhs 的 allow ViewHelper 相反,此 ViewHelper 接受用户组的 UID 作为参数。除了 UID,您还可以传递用户组的标题,但据我所知这可能不明确。

关于typo3 - 如何部分设置 VHS 的 AllowViewHelper 中的 FrontendUserGroup?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29824053/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com