[Zope3-dev] Re: principal events for the event hub

Christian Heimes heimes@faho.rwth-aachen.de
Sun, 13 Apr 2003 21:59:44 +0200


Steve Alexander wrote:
> 
>> class IPrincipalEvent(IEvent):
>>     """Something happens to a principal"""
> 
> This should contain a principal object. You can't have a principal event 
> if you don't have a principal.

This mistake bases on a misunderstanding. I thought that a anonymous 
access doesn't have a principal

Here is a retry:

class IPrincipalEvent(IEvent):
     """Something happens to a principal"""
     principal = Attribute("principal object")

# principal authentication source

class IPrincipalSourceEvent(IPrincipalEvent):
     """A principal authentication source has been changed"""

class IPrincipalAddedEvent(IPrincipalSourceEvent):
     """A principal is added"""

class IPrincipalRemovedEvent(IPrincipalSourceEvent):
     """A principal is removed"""

# is renaming a principal supported?
class IPrincipalChangedEvent(IPrincipalSourceEvent):
     """A principal has changed"""

# login/logout

class IPrincipalAuthenticationEvent(IPrincipalEvent):
     """A principal is logged in or off"""

class IPrincipalLoginEvent(IPrincipalAuthenticationEvent):
     """A principal has logged in successfully"""

class IPrincipalDeniedLoginEvent(IPrincipalAuthenticationEvent):
     """A principal couldn't be validated"""

class IPrincipalLogoutEvent(IPrincipalAuthenticationEvent):
     """A principal has logged out"""


# Maybe these events could be usefull, too:

class IPrincipalAccessEvent(IPrincipalEvent):
     """A principal tries to access an object""
     path = Attribute("path to the object")

class IPrincipalAllowedAccessEvent(IPrincipalAccessEvent):
     """A granted access"""

class IPrincipalDeniedAccessEvent(IPrincipalAccessEvent):
     """A denied access"""