For setting permission on the root application object, use
setPermissionDefault of SecurityInfo. 
e.g. in your product:

class MyClass: 
   security = ClassSecurityInfo()
   security.setPermissionDefault(Permissions.view, ('Owner',))

Reagrds,
Sandor 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Erik A.Dahl
> Sent: Wednesday, April 07, 2004 5:40 PM
> To: [EMAIL PROTECTED]
> Subject: [Zope-dev] manage_permission from script
> 
> 
> I'm trying to use manage_permission from a script against the root 
> application object.  When I do I get the following error from 
> ObjectManager.  This definitely works from within zope since I'm able 
> to edit permissions from the ZMI.  I guess the app object 
> returned from 
> Zope.app() doesn't have an acquisition wrapper?
> 
> -EAD
> 
>  >>> app.manage_permission("View", ['Owner',], 1)
> 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
> 
> 
> _______________________________________________
> Zope-Dev maillist  -  [EMAIL PROTECTED]
> http://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope )
> 


_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to