[Zope] setPermissionDefault
Chris McDonough
chrism@zope.com
Sat, 02 Mar 2002 17:13:37 -0500
Can you submit this as a collector issue? I'm not sure what's going on
but it sounds wrong.
Thanks!
- C
Sidnei da Silva wrote:
> Im trying to implement some default permissions on a product, which
> subclasses RoleManager, Folder, and CatalogAware.
>
> Defined some custom roles with:
>
> security = ClassSecurityInfo()
> __ac_roles__ = ('CustomRole1', 'CustomRole2')
>
> a method:
> security.declareProtected('APermission', 'mymethod')
> def mymethod(self, request):
> ....
>
> and a default Permission to CustomRole
> security.setPermissionDefault('APermission', ('CustomRole1', ))
>
> The roles show up on the Security tab, but when i try to check if a user with
> a role 'CustomRole1' has 'APermission', with:
> SecurityManagement.getSecurityManager().checkPermission('APermission', self)
>
> it always return None. If i go to the security tab and check 'APermission'
> for the role 'CustomRole1' it works, and checkPermission returns 1.
>
> I dont know what is wrong here, but if someone can help me, i will be very
> pleased.
>
> Thank you.
>
> []'s
>
--
Chris McDonough Zope Corporation
http://www.zope.org http://www.zope.com
"Killing hundreds of birds with thousands of stones"