Permissions problem

Hi there,

I've a question, when a open a page view object without this it work fine

a python: here.manage_changeProperties(hasDownloaded= (int(downloaded)+1));

but when I put this code here :slight_smile:

<metal:main fill-slot="main">
    <tal:main-macro metal:define-macro="main"
           tal:define="kssClassesView context/@@kss_field_decorator_view;
                      getKssClasses nocall:kssClassesView/getKssClassesInlineEditable;
                      templateId template/getId;
                      downloaded python:here.getProperty('hasDownloaded','');
                      titulo here/pretty_title_or_id;
                      resumo python:here.getProperty('resumo', '');
                      text python:here.getProperty('text', '');
                      item_data python:here.getProperty('data', '');
                      caminho python:'/'.join(here.getPhysicalPath());
 a python: here.manage_changeProperties(hasDownloaded= (int(downloaded)+1));

the browser is redirected to the login page.

How can I allow this view to let anonymous user do the "manage_changeProperties" of an objet?

  • code performing some modifications does not belong into a VIEW template but into a Python-based browser view
  • manage_ methods require Manager permissions
  • properties should not be MIS-used as counters. This will lead to a ZODB bloat. There are other way like an external database or whatever for managing counters but not the ZODB.


1 Like

Perhaps, i do not know if that will work, it's also an ugly way in my eyes, add a python-script in the zmi in your plone root and set the proxy_role of script to "Manager".

there is any way to call a python script on a link? like an onclick function ou something like that?

Or maybe on the href and then redirect to the file I want to download ?

Since you have the template under your own control you can write a related browser view yourself and hook into your own view template.


Don't reinvent the wheel.