[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope
Subject:    Re: [Zope] changing permissions in python
From:       "Dieter Maurer" <dieter () handshake ! de>
Date:       2008-10-14 18:27:48
Message-ID: 18676.58532.536436.592284 () gargle ! gargle ! HOWL
[Download RAW message or body]

Garry Saddington wrote at 2008-10-13 08:07 +0100:
>I have been searching everywhere for the correct syntax to use to change 
>permissions on a dtml method from a python script. I know it could be using 
>manage_changePermissions() but exactly how can I call it on any method.

Do not use "manage_changePermissions".
This method is designed a action for the corresponding management
interface page. In order to use it, you must build the request
in the same way as the action submit would do it -- difficult
and very error prone.

Instead use "manage_permission".
It sets the roles/acquire-flag for a single permission (e.g. the "View"
permission).
You call it directly on the object for which you want to change
the permissions, e.g. the "dtml method".


-- 
Dieter
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic