[Zope] setPermissionDefault

Sidnei da Silva sidnei@x3ng.com.br
Sat, 2 Mar 2002 14:17:05 -0300


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
-- 
Sidnei da Silva
X3ng Web Technology
sidnei@x3ng.com.br