Ignore:
Timestamp:
30 Mar 2011, 16:24:24 (14 years ago)
Author:
uli
Message:

Scan for external utilities implementing waeup.sirp.IAuthPluginUtility
when setting up the PAU.

File:
1 edited

Legend:

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

    r5055 r5900  
    33import grok
    44import waeup.sirp.permissions
    5 from zope.component import getUtility
     5from zope.component import getUtility, getUtilitiesFor
    66try:
    77    from zope.pluggableauth.plugins.session import SessionCredentialsPlugin
     
    2020from zope.securitypolicy.interfaces import IPrincipalRoleManager
    2121from zope.securitypolicy.principalrole import principalRoleManager
    22 from waeup.sirp.interfaces import IUserAccount
     22from waeup.sirp.interfaces import IUserAccount, IAuthPluginUtility
    2323
    2424def setup_authentication(pau):
     
    2727    Sets up an IAuthenticatorPlugin and
    2828    ICredentialsPlugin (for the authentication mechanism)
     29
     30    Then looks for any external utilities that want to modify the PAU.
    2931    """
    3032    pau.credentialsPlugins = ['No Challenge if Authenticated', 'credentials']
    3133    pau.authenticatorPlugins = ['users']
     34
     35    # Give any third-party code and subpackages a chance to modify the PAU
     36    auth_plugin_utilities = getUtilitiesFor(IAuthPluginUtility)
     37    for util in auth_plugin_utilities:
     38        util.register(pau)
    3239
    3340class WAeUPSessionCredentialsPlugin(grok.GlobalUtility,
Note: See TracChangeset for help on using the changeset viewer.