[Zope] Roles on the fly

Paul Winkler pw_lists@slinkp.com
Tue, 25 Feb 2003 13:12:17 -0500


On Tue, Feb 25, 2003 at 11:39:16AM +0100, Antonio Beamud Montero wrote:
> Hi all:
> I have defined some roles and I need to assign the roles to the users in
> a dynamic way...
> I'm thinking in doing that in the __call__ method of the root object of
> my hierarchy, there I modify the Request to authenticate the user with
> X.509 certificates and change the user roles... I the correct way?

i don't know... but:
you might want to read the thread "LOTS of Roles"
which has been going recently on the zope-dev mailing list.

one suggestion there was to create a custom UserFolder
whose Users override .getRolesInContext() with whatever code
you want, thereby giving you dynamic local roles.
i think you could have this overrule OR supplement the
normal roles and local roles, but I haven't tried it yet.

-- 

Paul Winkler
http://www.slinkp.com