AnsweredAssumed Answered

problem with permissions in template -check for parent read?

Question asked by stk137 on Sep 21, 2007
Latest reply on Dec 3, 2007 by kevinr
given some search results I am trying to display a link to the parent space using child.parent.url.  If a user doesn't have permissions it throws an error.

ok, so I added a check for permissions
<#if child.parent.hasPermission("Read")>

but that line throws the same error.

So how can you check for permissions on the parent node when you may not have permissions on that node (and that's why you are checking in the first place) ?

child.inheritsPermissions won't work when it does inherit but adds permissions.


For reference here's some of the error:
Error during processing of the template 'get(parent) failed on instance of org.alfresco.repo.template.TemplateNode'.

freemarker.template.TemplateModelException: get(parent) failed on instance of org.alfresco.repo.template.TemplateNode

Caused by: org.alfresco.repo.security.permissions.AccessDeniedException: Access Denied.  You do not have the appropriate permissions to perform this operation.


Outcomes