cancel
Showing results for 
Search instead for 
Did you mean: 

How to check the user access in document-details.ftl template?

xiebo
Champ in-the-making
Champ in-the-making
Scenario: I want to check whether a user can access this doc. If not, just ignore the following sub-templates (such as <@region id="web-preview" scope="template"/>).


<#if (hasAccess == "true")>
     <@region id="web-preview" scope="template"/>
</#if>


Question: How to check whether a user can access this doc in document-details.ftl template? Is there any TemplateNode that I can use? such as "document", etc
1 REPLY 1

niketapatel
Star Contributor
Star Contributor
I don't think there is any root object is available to check user permission on content. Only available is user is admin, guest.

As alternate solution, You can call alfresco script in js and may verify user access. You can refer - customise-dashboard.ftl and customise-dashboard.js

Hope this helps!