예제 #1
0
def setupSessionHelper(context, primaryAuth=True):
    acl = context.acl_users
    id = 'sessionAuthHelper'
    if not hasattr(acl, id):
        plugins.SessionAuthHelper.manage_addSessionAuthHelper(acl, id)

    interfaces = ['IExtractionPlugin', 'ICredentialsResetPlugin']
    if primaryAuth:
        interfaces.append('ICredentialsUpdatePlugin')
    acl.sessionAuthHelper.manage_activateInterfaces(interfaces)
예제 #2
0
def setupSessionHelper(context, primaryAuth=True):
    acl = context.acl_users
    id = 'sessionAuthHelper'
    if not hasattr(acl, id):
        plugins.SessionAuthHelper.manage_addSessionAuthHelper(acl, id)

    interfaces = ['IExtractionPlugin',
                  'ICredentialsResetPlugin']
    if primaryAuth:
        interfaces.append('ICredentialsUpdatePlugin')
    acl.sessionAuthHelper.manage_activateInterfaces(interfaces)
예제 #3
0
def setupCookieHelper(context, primaryAuth=False):
    acl = context.acl_users
    id = 'cookieAuthHelper'
    if not hasattr(acl, id):
        plugins.CookieAuthHelper.addCookieAuthHelper(acl, id)
    interfaces = []
    # note that we are only enabling CookieAuth for the Zenoss portal
    # acl_users, not for the root acl_users.
    physPath = '/'.join(context.getPhysicalPath())
    if physPath == '':
        interfaces = ['IExtractionPlugin']
    elif physPath == '/zport':
        interfaces = [
            'IExtractionPlugin', 'ICredentialsResetPlugin', 'IChallengePlugin'
        ]
    if primaryAuth:
        interfaces.append('ICredentialsUpdatePlugin')
    acl.cookieAuthHelper.manage_activateInterfaces(interfaces)
예제 #4
0
def setupCookieHelper(context, primaryAuth=False):
    acl = context.acl_users
    id = 'cookieAuthHelper'
    if not hasattr(acl, id):
        plugins.CookieAuthHelper.addCookieAuthHelper(acl, id)
    interfaces = []
    # note that we are only enabling CookieAuth for the Zenoss portal
    # acl_users, not for the root acl_users.
    physPath = '/'.join(context.getPhysicalPath())
    if physPath == '':
        interfaces = ['IExtractionPlugin']
    elif physPath == '/zport':
        interfaces = ['IExtractionPlugin',
                      'ICredentialsResetPlugin',
                      'IChallengePlugin']
    if primaryAuth:
        interfaces.append('ICredentialsUpdatePlugin')
    acl.cookieAuthHelper.manage_activateInterfaces(interfaces)