cancel
Showing results for 
Search instead for 
Did you mean: 

Permission on file, but not on parent

dranakan
Champ on-the-rise
Champ on-the-rise
Hello,

I would to put read permission on a file, but not to its parent.
If I do this, I can see the preview but not other option like download the document. The preview is like this :

http://imageshack.us/photo/my-images/41/nopermissiononparent.png/

I get this error

2012-03-02 08:05:05,678  ERROR [freemarker.runtime] [http-8080-6] Template processing error: "Expression item.parent.nodeJSON is undefined on line 19, column 49 in org/alfresco/slingshot/documentlibrary-v2/node.get.json.ftl."

Expression item.parent.nodeJSON is undefined on line 19, column 49 in org/alfresco/slingshot/documentlibrary-v2/node.get.json.ftl.
The problematic instruction:
———-
==> ${item.parent.nodeJSON} [on line 19, column 47 in org/alfresco/slingshot/documentlibrary-v2/node.get.json.ftl]
———-

Java backtrace for programmers:
———-
freemarker.core.InvalidReferenceException: Expression item.parent.nodeJSON is undefined on line 19, column 49 in org/alfresco/slingshot/documentlibrary-v2/node.get.json.ftl.
        at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
        at freemarker.core.Expression.getStringValue(Expression.java:118)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.NoEscapeBlock.accept(NoEscapeBlock.java:70)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.EscapeBlock.accept(EscapeBlock.java:84)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.Environment.process(Environment.java:199)
        at org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:202)
        at org.springframework.extensions.webscripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:800)
        at org.springframework.extensions.webscripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:267)
        at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)
        at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:393)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:388)
        at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:462)
        at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:500)
        at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:316)
        at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:372)
        at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
        at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:662)
2012-03-02 08:05:05,679  ERROR [extensions.webscripts.AbstractRuntime] [http-8080-6] Exception from executeScript - redirecting to status template error: 02020009 Wrapped Exception (with status template): 02021987 Error during processing of the template 'Expression item.parent.nodeJSON is undefined on line 19, column 49 in org/alfresco/slingshot/documentlibrary-v2/node.get.json.ftl.'. Please contact your system administrator.
org.springframework.extensions.webscripts.WebScriptException: 02020009 Wrapped Exception (with status template): 02021987 Error during processing of the template 'Expression item.parent.nodeJSON is undefined on line 19, column 49 in org/alfresco/slingshot/documentlibrary-v2/node.get.json.ftl.'. Please contact your system administrator.
        at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:970)
        at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)
        at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:393)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:388)
        at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:462)
        at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:500)
        at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:316)
        at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:372)
        at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
        at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:662)
Caused by: org.alfresco.service.cmr.repository.TemplateException: 02021987 Error during processing of the template 'Expression item.parent.nodeJSON is undefined on line 19, column 49 in org/alfresco/slingshot/documentlibrary-v2/node.get.json.ftl.'. Please contact your system administrator.
        at org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:206)
        at org.springframework.extensions.webscripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:800)
        at org.springframework.extensions.webscripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:267)
        at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)
        … 25 more
Caused by: freemarker.core.InvalidReferenceException: Expression item.parent.nodeJSON is undefined on line 19, column 49 in org/alfresco/slingshot/documentlibrary-v2/node.get.json.ftl.
        at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
        at freemarker.core.Expression.getStringValue(Expression.java:118)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.NoEscapeBlock.accept(NoEscapeBlock.java:70)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.EscapeBlock.accept(EscapeBlock.java:84)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.Environment.process(Environment.java:199)
        at org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:202)
        … 28 more

My goal is to give permission on a specific document during a workflow and remove the access at the end of the workflow. I don't want to give access to the parent (because it will give access to all node inside the directory).
My idea is possible or it's not logic to do this like this ?
(I can also move the document inside a new directory and remove again at the end of the workflow)
4.0D, RHEL5.6
2 REPLIES 2

mrogers
Star Contributor
Star Contributor
yes your idea is logical.   However there are a collection of bugs/ features in the various interfaces that require read access to the parent node. 

You may have seen in alfresco's jira some renewed chatter about implementing something like unix's x permissions. But it's not there at the moment,  and as you have seen share tries to read the parent folder.

dranakan
Champ on-the-rise
Champ on-the-rise
Thank you mrogers.
I will move my document in a temporary directory…

Best regards.