Ignore:
Timestamp:
23 Nov 2011, 07:19:16 (13 years ago)
Author:
Henrik Bettermann
Message:

Define get_user_account in helpers and use it.

File:
1 edited

Legend:

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

    r7137 r7175  
    88from cStringIO import StringIO
    99from docutils.core import publish_string
     10from zope.component import getUtility
    1011from zope.component.interfaces import IFactory
    1112from zope.interface import implementedBy
     
    1415from zope.security.interfaces import NoInteraction
    1516from zope.security.management import getInteraction
     17from zope.pluggableauth.interfaces import IAuthenticatorPlugin
    1618
    1719BUFSIZE = 8 * 1024
     
    451453    file_like_obj.seek(0, 2) # seek to last position in file
    452454    return file_like_obj.tell()
     455
     456def get_user_account(request):
     457    """Return local user account.
     458    """
     459    principal_id = request.principal.id
     460    authenticator = getUtility(IAuthenticatorPlugin, name='users')
     461    account = authenticator.getAccount(principal_id)
     462    return account
     463
Note: See TracChangeset for help on using the changeset viewer.