cancel
Showing results for 
Search instead for 
Did you mean: 

Freemarker Access Is Denied Exception

lista
Star Contributor
Star Contributor
I'm talking about a Java backed web script that finds a node, and using Freemarker as a template outputs its properties in a JSON format. Now, even though I have permissions on a node (I've added them through Explorer, I can view it, edit it, you name it - so there's no room for error here), I still get the Access is Denied exception.

Here's the code responsible.


<#list currNode.properties?keys as p>
<#assign propNode=currNode>

<#if currNode.properties[p]?exists && p?index_of("{http://www.alfresco.org/model/content/1.0}content") == 0 >      
          ,"cm:content":"not_used"        
<#elseif currNode.properties[p]?exists && p?index_of("{http://www.alfresco.org/model/content/1.0}") == 0 >      
   ,"${msg(p?replace("{http://www.alfresco.org/model/content/1.0}", "cm:"))}"        
   <#include "/com/itsistemi/more/scripts/general/convertPropTypesJSON.ftl">       
</#if>    
</#list>


Included code simply find out if a property is boolean, string, etc, so no funny business there.
Has anyone encountered something like this, suggestions, help?
2 REPLIES 2

mitpatoliya
Star Collaborator
Star Collaborator
sometimes although you have permission on particular node There were restriction on the APIs which you are using.So, you need to check for that.

zladuric
Champ on-the-rise
Champ on-the-rise
A couple of possible issues:
- access on the webscript: how did you authenticate? As the same user that created this node?
- can you do the same on, say, companyhome or maybe userhome node? Or make a public, guest-allowed node?
- maybe your java bean is not configured correctly. if you replace the whole freemarker thing with nothing (just delete it all) and try again, do you get the same error?