Ignore:
Timestamp:
28 Nov 2011, 21:04:57 (13 years ago)
Author:
Henrik Bettermann
Message:

Implement SIRPPrincipalInfo and SIRPPrincipal classes which provide ordinary principals with an extra email and phone attribute.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py

    r7225 r7233  
    2323from zc.sourcefactory.basic import BasicSourceFactory
    2424from zope import schema
     25from zope.pluggableauth.interfaces import IPrincipalInfo
     26from zope.security.interfaces import IGroupClosureAwarePrincipal as IPrincipal
    2527from zope.component import getUtility
    2628from zope.component.interfaces import IObjectEvent
     
    232234        required = True,)
    233235
     236class ISIRPPrincipalInfo(IPrincipalInfo):
     237    """Infos about principals that are users of WAeUP SIRP.
     238    """
     239    email = Attribute("The email address of a user")
     240    phone = Attribute("The phone number of a user")
     241
     242
     243class ISIRPPrincipal(IPrincipal):
     244    """A principle for WAeUP SIRP.
     245
     246    This interface extends zope.security.interfaces.IPrincipal and
     247    requires also an `id` and other attributes defined there.
     248    """
     249
     250    email = schema.TextLine(
     251        title = u'Email',
     252        description = u'',
     253        required=False,)
     254
     255    phone = schema.Int(
     256        title = u'Phone',
     257        description = u'',
     258        required=False,)
    234259
    235260class IUserAccount(IWAeUPObject):
     
    255280        required = True,
    256281        constraint=validate_email,
     282        )
     283
     284    phone = schema.Int(
     285        title = u'Phone',
     286        default = None,
     287        required = True,
    257288        )
    258289
Note: See TracChangeset for help on using the changeset viewer.