[Grok-dev] remove roles vom principal

Jens Adner j.adner at fh-sm.de
Tue Sep 23 06:07:53 EDT 2008


Hello,

I did assign three roles  to my ldap principal, and remove two of them
later again:

[(u'mysite.Member', PermissionSetting: Deny), (u'mysite.Member3',
PermissionSetting: Deny), (u'mysite.Member2', PermissionSetting: Allow)]

I do this by removing all roles for a principal first and assign a
specific role to this principal in a second step.

This is my code for removing:

prm = IPrincipalRoleManager(app)
 ## first remove all roles from principal
rolesForRemove=prm.getRolesForPrincipal(principal.id)
for role in rolesForRemove:
   prm.removeRoleFromPrincipal(role[0],principal.id)

My question is, how can I remove these roles forever, the function above
does not erase the roles, just setting them to "Deny".

Maybe this is a feature and I did not understand it ;-)

Regards,
Jens

-- 
++++++++ Jens Adner IuK-Zentrum Fachhochschule Schmalkalden +++++++++
++++++++ Fon: +49 3683 6889201  Fax: +49 3683 6889499 +++++++++++++++
++++++++     Jabber: adnus at jabber.ccc.de  +++++++++++++++++++++++++++


More information about the Grok-dev mailing list