collective / sc.social.like

Social: Like Actions is a Plone package (add-on) providing simple Google+, Twitter and Facebook integration for Plone Content Types.
7 stars 23 forks source link

Viewlet is raising Unauthorized #146

Open hvelarde opened 6 years ago

hvelarde commented 6 years ago

I see a lot of errors like this one on the event log of a site using the latest version of the package (2.13b1):

2017-10-01T00:22:32 ERROR root Exception while rendering an error message
Traceback (most recent call last):
  File "/opt/plone/buildout/eggs/Zope2-2.13.24-py2.7.egg/OFS/SimpleItem.py", line 242, in raise_standardErrorMessage
    v = s(**kwargs)
  File "/opt/plone/buildout/eggs/Products.CMFCore-2.2.9-py2.7.egg/Products/CMFCore/FSPythonScript.py", line 127, in __call__
    return Script.__call__(self, *args, **kw)
  File "/opt/plone/buildout/eggs/Zope2-2.13.24-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 322, in __call__
    return self._bindAndExec(args, kw, None)
  File "/opt/plone/buildout/eggs/Zope2-2.13.24-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 359, in _bindAndExec
    return self._exec(bound_data, args, kw)
  File "/opt/plone/buildout/eggs/Products.PythonScripts-2.13.2-py2.7.egg/Products/PythonScripts/PythonScript.py", line 344, in _exec
    result = f(*args, **kw)
  File "Script (Python)", line 35, in standard_error_message
  File "/opt/plone/buildout/eggs/Zope2-2.13.24-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 322, in __call__
    return self._bindAndExec(args, kw, None)
  File "/opt/plone/buildout/eggs/Zope2-2.13.24-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 359, in _bindAndExec
    return self._exec(bound_data, args, kw)
  File "/opt/plone/buildout/eggs/Products.CMFCore-2.2.9-py2.7.egg/Products/CMFCore/FSPageTemplate.py", line 237, in _exec
    result = self.pt_render(extra_context=bound_names)
  File "/opt/plone/buildout/eggs/Products.CMFCore-2.2.9-py2.7.egg/Products/CMFCore/FSPageTemplate.py", line 177, in pt_render
    self, source, extra_context
  File "/opt/plone/buildout/eggs/Zope2-2.13.24-py2.7.egg/Products/PageTemplates/PageTemplate.py", line 87, in pt_render
    showtal=showtal)
  File "/opt/plone/buildout/eggs/zope.pagetemplate-3.6.3-py2.7.egg/zope/pagetemplate/pagetemplate.py", line 132, in pt_render
    strictinsert=0, sourceAnnotations=sourceAnnotations
  File "/opt/plone/buildout/eggs/five.pt-2.2.4-py2.7.egg/five/pt/engine.py", line 98, in __call__
    return self.template.render(**kwargs)
  File "/opt/plone/buildout/eggs/z3c.pt-2.2.3-py2.7.egg/z3c/pt/pagetemplate.py", line 149, in render
    return base_renderer(**context)
  File "/opt/plone/buildout/eggs/Chameleon-2.25-py2.7.egg/chameleon/zpt/template.py", line 261, in render
    return super(PageTemplate, self).render(**vars)
  File "/opt/plone/buildout/eggs/Chameleon-2.25-py2.7.egg/chameleon/template.py", line 191, in render
    raise_with_traceback(exc, tb)
  File "/opt/plone/buildout/eggs/Chameleon-2.25-py2.7.egg/chameleon/template.py", line 171, in render
    self._render(stream, econtext, rcontext)
  File "/opt/plone/buildout/var/chameleon-cache/14928bd92ef7b3eb8d5412c7a9082c03.py", line 971, in render
    __macro.include(__stream, econtext.copy(), rcontext, __i18n_domain)
  File "/opt/plone/buildout/var/chameleon-cache/5530f31b32da953c907f4546851d8bb9.py", line 1025, in render_master
    __cache_139918644650640 = _render_content_provider(econtext, __cache_139918644650640)
  File "/opt/plone/buildout/eggs/z3c.pt-2.2.3-py2.7.egg/z3c/pt/expressions.py", line 58, in render_content_provider
    cp.update()
  File "/opt/plone/buildout/eggs/zope.viewlet-3.7.2-py2.7.egg/zope/viewlet/manager.py", line 112, in update
    self._updateViewlets()
  File "/opt/plone/buildout/eggs/zope.viewlet-3.7.2-py2.7.egg/zope/viewlet/manager.py", line 118, in _updateViewlets
    viewlet.update()
  File "/opt/plone/buildout/eggs/sc.social.like-2.13b1-py2.7.egg/sc/social/like/browser/viewlets.py", line 82, in update
    self.image = get_content_image(self.context)
  File "/opt/plone/buildout/eggs/sc.social.like-2.13b1-py2.7.egg/sc/social/like/utils.py", line 45, in get_content_image
    sizes = view.getImageSize(field)
  File "/opt/plone/buildout/eggs/plone.namedfile-3.0.11-py2.7.egg/plone/namedfile/scaling.py", line 225, in getImageSize
    value = self.guarded_orig_image(fieldname)
  File "/opt/plone/buildout/eggs/plone.namedfile-3.0.11-py2.7.egg/plone/namedfile/scaling.py", line 233, in guarded_orig_image
    return guarded_getattr(self.context, fieldname, None)
Unauthorized: You are not allowed to access 'image' in this context

 - Expression: "provider:plone.htmlhead"
 - Filename:   ... theme/sunburst/skins/sunburst_templates/main_template.pt
 - Location:   (line 31: col 36)
 - Source:     ... al:replace="structure provider:plone.htmlhead" />
                                         ^^^^^^^^^^^^^^^^^^^^^^^
 - Arguments:  repeat: {...} (0)
               template: <ImplicitAcquisitionWrapper default_error_message at 0x7f6f228dd960>
               modules: <instance - at 0x7f6f307ca7e8>
               here: <ImplicitAcquisitionWrapper as-empresas-mais-admiradas-no-brasil-em-2015-3537.html at 0x7f6eff77be60>
               user: <ImplicitAcquisitionWrapper - at 0x7f6eff77b820>
               nothing: <NoneType - at 0x8fe4d0>
               container: <ImplicitAcquisitionWrapper as-empresas-mais-admiradas-no-brasil-em-2015-3537.html at 0x7f6eff77be60>
               default: <object - at 0x7f6f3785c520>
               request: <instance - at 0x7f6edd4de128>
               wrapped_repeat: <SafeMapping - at 0x7f6edcd5baa0>
               traverse_subpath: <list - at 0x7f6edd0f9050>
               loop: {...} (0)
               context: <ImplicitAcquisitionWrapper as-empresas-mais-admiradas-no-brasil-em-2015-3537.html at 0x7f6eff77be60>
               translate: <function translate at 0x7f6ee4bd0488>
               root: <ImplicitAcquisitionWrapper Zope at 0x7f6f222bb910>
               options: {...} (9)
               target_language: pt_BR