[Zope-dev] manage_permission from script

Erik A.Dahl edahl at zentinel.com
Thu Apr 8 08:41:10 EDT 2004


Thanks for the suggestion but no joy here.  Here is the full trace...

Python 2.3.3 (#1, Jan 27 2004, 09:17:28)
[GCC 3.2 20020903 (Red Hat Linux 8.0 3.2-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import Zope
 >>> app = Zope.app()
 >>> app.testfolder
<Folder instance at 410d9f50>
 >>> tf = app.testfolder
 >>> tf.getPhysicalRoot().manage_permission("View", ["Owner",])
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/home/edahl/zope-2.7.0/lib/python/AccessControl/Role.py", line 
164, in manage_permission
     for p in self.ac_inherited_permissions(1):
   File "/home/edahl/zope-2.7.0/lib/python/AccessControl/Role.py", line 
82, in ac_inherited_permissions
     for p in self._subobject_permissions():
   File "/home/edahl/zope-2.7.0/lib/python/OFS/ObjectManager.py", line 
212, in _subobject_permissions
     return (Products.__ac_permissions__+
AttributeError: aq_acquire



On Apr 7, 2004, at 7:30 PM, <zope at netchan.cotse.net> wrote:

>> For setting permission on the root application object, use
>> setPermissionDefault of SecurityInfo.
>
> Eh, this only works for my own defined permissions. However I just 
> tried
> this from my product and it does what it supposed to do:
> 	
> self.getPhysicalRoot().manage_permission('View', ['Owner'])
>
> Sandor




More information about the Zope-Dev mailing list