cancel
Showing results for 
Search instead for 
Did you mean: 

Guest Download Servlet

jjf
Champ in-the-making
Champ in-the-making
I have a space which I want anonymous users to have read access to, so  I've added the guest account to the space as a Consumer.  This works fine with CIFS and the mapUnknownUserToGuest file system param. 

When I try accessing files in the space via web link:

http://localhost:8080/alfresco/download/direct/workspace/SpacesStore/7c8b1d88-aa66-11dc-a6e6-2f47cea...

I get redirect to the login page.  I check the log which shows:

WARN  [org.alfresco.web.app.servlet.AuthenticationHelper] Unable to login as Guest: Access Denied.  You do not have the appropriate permissions to perform this operation.

I've added guest=true as an arugment and tried the guestDownload servlet.  It's pretty much an out of the box deployment, so I can't see what would cause the issue.  Any ideas?
12 REPLIES 12

kevinr
Star Contributor
Star Contributor
I'm not sure what's wrong here - it sounds like it should work, the error is strange. If you are getting AccessDeniedException it's like the Guest user does not have permissions on their own Person node or the Guest home space. You said it's pretty much an out-of-the-box deployment but are there any changes relevant to the Guest home space or Guest person node?

Kevin

jjf
Champ in-the-making
Champ in-the-making
Thanks for the response.

The guest user is a Consumer on the Guest Home space (as well as Company Home). 

I did have to recreate the guest user because it looked like it was corrupt (the username became something like "guest123213-213123-213") and people couldn't login through CIFs using the guest account.  Once I recreated it, people were able to get in through CIFs.  Could it be that recreating it fixed CIFs but broke the web client?

kevinr
Star Contributor
Star Contributor
Check that the Guest user Home Space is set to the Guest space, and ensure that the Guest user has Write permissions on the Guest Person node.

jjf
Champ in-the-making
Champ in-the-making
I've verified the Home Space for Guest is "Guest Home".  How do I ensure the Guest user can write to the Guest person node?

kevinr
Star Contributor
Star Contributor
Log in admin - go to the Node Browser tool in the Admin Console. Navigate into workspace://SpacesStore store, then into:
{http://www.alfresco.org/model/system/1.0}system then into {http://www.alfresco.org/model/system/1.0}people. The second item in the Children list will probably be the Guest user, click it. Under Permissions you should see: Read   guest   ALLOWED
If not, then you'll need to write a small Javascript (or whatever API you prefer) to modify the permission on that node so that guest has Read.

Kevin

jjf
Champ in-the-making
Champ in-the-making
Thanks.  That might be the issue.  "guest Allowed" is not set as a permission.   I'll let you know how it turns out.

jjf
Champ in-the-making
Champ in-the-making
I tried running JavaScript to update the permission but received the following error when running:

Please correct the errors below then click Finish.
Failed to run Actions due to error: Failed to execute script 'workspace://SpacesStore/6c51b4e6-0a1f-11dc-a36b-194fa988ca23': org.mozilla.javascript.Context.initStandardObjects()Lorg/mozilla/javascript/ScriptableObject;

This happens on any JavaScript I run, even the samples.  Any ideas?

I can always use the Java API to fix the permission issue but I'd like to figure out what's wrong with the JavaScript.

kevinr
Star Contributor
Star Contributor
Is there any more to that error trace? It looks like a bigger problem with your setup - what app-server are you using?

Kevin

jjf
Champ in-the-making
Champ in-the-making
Here's the full dump from console:

09:08:51,771 ERROR [ui.common.Utils] Failed to run Actions due to error: Failed to execute script 'workspace://SpacesStore/6c51b4e6-0a1f-11dc-a36b-194fa988ca23': org.mozilla.javascript.Context.initStandardObjects()Lorg/mozilla/javascript/ScriptableObject;
org.alfresco.service.cmr.repository.ScriptException: Failed to execute script 'workspace://SpacesStore/6c51b4e6-0a1f-11dc-a36b-194fa988ca23': org.mozilla.javascript.Context.initStandardObjects()Lorg/mozilla/javascript/ScriptableObject;
   at org.alfresco.repo.jscript.RhinoScriptService.executeScript(RhinoScriptService.java:168)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
   at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:116)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:204)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
   at $Proxy55.executeScript(Unknown Source)
   at org.alfresco.repo.action.executer.ScriptActionExecuter.executeImpl(ScriptActionExecuter.java:148)
   at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:120)
   at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:537)
   at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:472)
   at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:399)
   at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:387)
   at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:545)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
   at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:116)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditComponentImpl.java:219)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:165)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
   at $Proxy17.executeAction(Unknown Source)
   at org.alfresco.web.bean.actions.RunActionWizard.finishImpl(RunActionWizard.java:98)
   at org.alfresco.web.bean.dialog.BaseDialogBean.finish(BaseDialogBean.java:115)
   at org.alfresco.web.bean.wizard.WizardManager.finish(WizardManager.java:521)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
   at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
   at javax.faces.component.UICommand.broadcast(UICommand.java:106)
   at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
   at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
   at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
   at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:105)
   at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
   at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
   at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
   at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
   at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
   at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
   at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3151)
   at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
   at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
   at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
   at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
   at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
   at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
   at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
Caused by: org.alfresco.error.AlfrescoRuntimeException: org.mozilla.javascript.Context.initStandardObjects()Lorg/mozilla/javascript/ScriptableObject;
   at org.alfresco.repo.jscript.RhinoScriptService.executeScriptImpl(RhinoScriptService.java:311)
   at org.alfresco.repo.jscript.RhinoScriptService.executeScript(RhinoScriptService.java:164)
   … 78 more
Caused by: java.lang.NoSuchMethodError: org.mozilla.javascript.Context.initStandardObjects()Lorg/mozilla/javascript/ScriptableObject;
   at org.alfresco.repo.jscript.RhinoScriptService.executeScriptImpl(RhinoScriptService.java:266)
   … 79 more

I am running on Weblogic 9.2.