[Zope3-dev] How to get Principals Roles? Owner-Role?

Administrator admin@larp-welt.de
14 Jun 2003 22:12:46 +0200


Hi Again!

How do I get the roles of a given principal?

This code, I have stolen from NewsSite doesnt work for me, because a
Principal doesn't have any methode getRoles()::

	authsvc = getService(self.context, Authentication)
        authsvc.authenticate(self.request)
        principal = getSecurityManager().getPrincipal()
        return {'id' : principal.getId(),
                'title' : principal.getTitle(),
                'roles' : principal.getRoles()
               }

I had a look through Zopes Sources, and found: only User has such a
methode. How do I get Roles for a Principal, or how do I get a User
instead of a Principal?

Is there such a thing as a role Owner or Creator for an object, so that
the creator may have some special rights, others don't have?

Bye
   Marcus