コード例 #1
0
def patch_ldapmp():
    from Products.LDAPMultiPlugins.LDAPPluginBase import LDAPPluginBase
    wrap_method(
        LDAPPluginBase,
        'getPropertiesForUser',
        getPropertiesForUser
    )

    from Products.LDAPMultiPlugins.LDAPMultiPlugin import LDAPMultiPlugin
    wrap_method(
        LDAPMultiPlugin,
        'getGroupsForPrincipal',
        getGroupsForPrincipal
    )
コード例 #2
0
def patch_pas():
    # sort alphabetically by patched/added method name
    wrap_method(PluggableAuthService, '_delOb', _delOb)
    wrap_method(
        PluggableAuthService,
        '_getAllLocalRoles',
        _getAllLocalRoles,
        add=True,
    )
    wrap_method(PluggableAuthService, '_doAddGroup', _doAddGroup, add=True)
    wrap_method(PluggableAuthService, '_doAddUser', _doAddUser)
    wrap_method(PluggableAuthService,
                '_doChangeGroup',
                _doChangeGroup,
                add=True)
    wrap_method(PluggableAuthService, '_doChangeUser', _doChangeUser, add=True)
    wrap_method(PluggableAuthService, '_doDelGroups', _doDelGroups, add=True)
    wrap_method(PluggableAuthService, '_doDelUser', _doDelUser, add=True)
    wrap_method(PluggableAuthService,
                '_doDelUsers',
                _doDelUsers,
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))
    wrap_method(PluggableAuthService,
                '_getLocalRolesForDisplay',
                _getLocalRolesForDisplay,
                add=True)
    wrap_method(PluggableAuthService, '_updateGroup', _updateGroup, add=True)
    wrap_method(PluggableAuthService,
                'addRole',
                addRole,
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))
    wrap_method(
        PluggableAuthService,
        'authenticate',
        authenticate,
        add=True,
        roles=(),
    )
    wrap_method(PluggableAuthService,
                'canListAllGroups',
                canListAllGroups,
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))
    wrap_method(PluggableAuthService,
                'canListAllUsers',
                canListAllUsers,
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))
    wrap_method(PluggableAuthService,
                'credentialsChanged',
                credentialsChanged,
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))
    wrap_method(
        PluggableAuthService,
        'getAllLocalRoles',
        getAllLocalRoles,
        add=True,
    )
    wrap_method(PluggableAuthService,
                'getGroup',
                getGroup,
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))
    wrap_method(PluggableAuthService,
                'getGroupById',
                getGroupById,
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))
    wrap_method(PluggableAuthService,
                'getGroupByName',
                getGroupByName,
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))
    wrap_method(PluggableAuthService,
                'getGroupIds',
                getGroupIds,
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))
    wrap_method(PluggableAuthService,
                'getGroupNames',
                getGroupNames,
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))
    wrap_method(PluggableAuthService,
                'getGroups',
                getGroups,
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))
    wrap_method(
        PluggableAuthService,
        'getLocalRolesForDisplay',
        getLocalRolesForDisplay,
        add=True,
    )
    wrap_method(
        PluggableAuthService,
        'getUserIds',
        getUserIds,
        add=True,
        deprecated="Inefficient GRUF wrapper, use IUserIntrospection instead.")
    wrap_method(
        PluggableAuthService,
        'getUserNames',
        getUserNames,
        add=True,
        deprecated="Inefficient GRUF wrapper, use IUserIntrospection instead.")
    wrap_method(PluggableAuthService,
                'getUsers',
                getUsers,
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))
    wrap_method(PluggableAuthService,
                'getPureUsers',
                getUsers,
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))
    wrap_method(PluggableAuthService,
                'userFolderAddUser',
                postonly(userFolderAddUser),
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))
    wrap_method(PluggableAuthService,
                'userFolderDelUsers',
                postonly(_doDelUsers),
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))
    wrap_method(PluggableAuthService,
                'userFolderEditGroup',
                postonly(_doChangeGroup),
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))
    wrap_method(PluggableAuthService,
                'userFolderEditUser',
                postonly(_doChangeUser),
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))
    wrap_method(PluggableAuthService,
                'userFolderDelGroups',
                postonly(_doDelGroups),
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))
    wrap_method(PluggableAuthService,
                'userSetGroups',
                _userSetGroups,
                add=True,
                deprecated="Method from GRUF was removed.")
    wrap_method(PluggableAuthService,
                'userSetPassword',
                userSetPassword,
                add=True,
                roles=PermissionRole(ManageUsers, ('Manager', )))