コード例 #1
0
ファイル: Security.py プロジェクト: zenoss/zenoss-prodbin
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
ファイル: Security.py プロジェクト: zenoss/zenoss-prodbin
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)