我的 Umbraco4 网站的每个页面的右侧都有一个图形面板。我希望该面板仅在登录用户有权访问它链接到的页面时出现。如果没有,我希望面板消失。
该面板显示正确,但当用户无权访问该页面时它不会消失。结果,用户在单击链接后会看到“您无权访问此页面”文本页面。
我可以在下面的代码中添加什么以使其启用权限? 请注意,我也愿意将其转换为 Razor。
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<!-- Input the documenttype you want here -->
<xsl:variable name="documentTypeAlias" select="string('HomePage')"/>
<xsl:template match="/">
<xsl:for-each select="$currentPage/ancestor-or-self::root//* [name() = $documentTypeAlias and string(umbracoNaviHide) != '1' and (umbraco.library:IsProtected(@id, @path) = false() or umbraco.library:HasAccess(@id, @path) = true())]">
<xsl:if test="./editorsManualLink != ''">
<a href="{umbraco.library:NiceUrl(./editorsManualLink)}" target="_self" class="editorsManual" title="Visit the Editor’s manual">
<h3>Editor’s manual</h3>
</a>
</xsl:if>
</xsl:for-each>
</xsl:template>