You are here: Home / Documentation / How To's / How to fix the error "Unauthorized: You are not allowed to access XXX in this context"

How to fix the error "Unauthorized: You are not allowed to access XXX in this context"

by nguyen — published Jun 14, 2012 12:37 PM, last modified Aug 16, 2016 10:50 AM

We received this error, which you can see in detail in the log on the file system or via the ZMI error_log if you comment out "Unauthorized" in the types of exceptions to ignore.

Traceback (innermost last):
  Module ZPublisher.Publish, line 127, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 47, in call_object
  Module Products.Five.browser.metaconfigure, line 477, in __call__
  Module Products.Five.browser.pagetemplatefile, line 126, in __call__
  Module Products.Five.browser.pagetemplatefile, line 60, in __call__
  Module zope.pagetemplate.pagetemplate, line 113, in pt_render
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 888, in do_useMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 852, in do_condition
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 531, in do_optTag_tal
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 742, in do_insertStructure_tal
  Module Products.PageTemplates.Expressions, line 220, in evaluateStructure
  Module zope.tales.tales, line 696, in evaluate
   - URL: file:/opt/Plone-4.0.2-2/buildout-cache/eggs/Plone-4.0.2-py2.6.egg/Products/CMFPlone/skins/plone_templates/main_template.pt
   - Line 80, Column 8
   - Expression: <StringExpr u'plone.portaltop'>
   - Names:
      {'args': (),
       'container': <ATFolder at /sites5/Art/students>,
       'context': <ATFolder at /sites5/Art/students>,
       'default': <object object at 0x2b318dbf2ae0>,
       'here': <ATFolder at /sites5/Art/students>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x1178d4c8>,
       'request': <HTTPRequest, URL=http://plone3.webcluster.uwosh.edu:12082/sites5/Art/students/folder_contents>,
       'root': <Application at >,
       'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0xb291750>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'myuser'>,
       'view': <Products.Five.metaclass.SimpleViewClass from /opt/Plone-4.0.2-2/buildout-cache/eggs/plone.app.content-2.0.1-py2.6.egg/plone/app/content/browser/folder_contents.pt object at 0x15d6fa50>,
       'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x158d92d0>}
  Module zope.contentprovider.tales, line 80, in __call__
  Module plone.app.viewletmanager.manager, line 154, in render
  Module plone.app.viewletmanager.manager, line 85, in render
  Module five.customerize.zpt, line 143, in render
  Module Products.PageTemplates.ZopePageTemplate, line 335, in _exec
  Module Products.PageTemplates.ZopePageTemplate, line 432, in pt_render
  Module Products.PageTemplates.PageTemplate, line 80, in pt_render
  Module zope.pagetemplate.pagetemplate, line 113, in pt_render
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 852, in do_condition
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 376, in do_startEndTag
  Module zope.tal.talinterpreter, line 405, in do_startTag
  Module zope.tal.talinterpreter, line 482, in attrAction_tal
  Module Products.PageTemplates.Expressions, line 227, in evaluateText
  Module zope.tales.tales, line 696, in evaluate
   - URL: /sites5/Art/home/zope.interface.interface-uwosh.themebase.mainimage
   - Line 45, Column 8
   - Expression: <PythonExpr len(view.image_urls) > 0 and view.image_urls[0]>
   - Names:
      {'container': <ATFolder at /sites5/Art/students>,
       'context': <ATFolder at /sites5/Art/students>,
       'default': <object object at 0x2b318dbf2ae0>,
       'here': <ATFolder at /sites5/Art/students>,
       'loop': {},
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xfeca890>,
       'request': <HTTPRequest, URL=http://plone3.webcluster.uwosh.edu:12082/sites5/Art/students/folder_contents>,
       'root': <Application at >,
       'template': <TTWViewTemplate at /sites5/Art/students/zope.interface.interface-uwosh.themebase.mainimage>,
       'user': <PropertiedUser 'myuser'>,
       'view': <five.customerize.zpt.TTWViewlet object at 0x150eb050>}
  Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
   - __traceback_info__: len(view.image_urls) > 0 and view.image_urls[0]
  Module PythonExpr, line 1, in <expression>
Unauthorized: You are not allowed to access 'image_urls' in this context

In our case we use LDAP and the owner of an object had his user ID changed in LDAP.  The fix for this was to take ownership of that object, changing its owner from a user that no longer exists to one that does exist.

 

Navigation