Class FakeUserManagerImpl

    • Constructor Detail

      • FakeUserManagerImpl

        public FakeUserManagerImpl()
    • Method Detail

      • setUserListingMode

        public void setUserListingMode​(String userListingMode)
      • setGroupListingMode

        public void setGroupListingMode​(String groupListingMode)
      • setDefaultGroup

        public void setDefaultGroup​(String defaultGroup)
      • setUserSortField

        public void setUserSortField​(String sortField)
      • setGroupSortField

        public void setGroupSortField​(String sortField)
      • setUserDirectoryName

        public void setUserDirectoryName​(String userDirectoryName)
      • setUserEmailField

        public void setUserEmailField​(String userEmailField)
      • setUserSearchFields

        public void setUserSearchFields​(Set<String> userSearchFields)
      • getUserSearchFields

        public Set<String> getUserSearchFields()
        Description copied from interface: UserManager
        Gets the user search fields, the fields to use when a principal search is done.
        Specified by:
        getUserSearchFields in interface UserManager
        Returns:
        the search fields.
      • setGroupDirectoryName

        public void setGroupDirectoryName​(String groupDirectoryName)
      • setGroupMembersField

        public void setGroupMembersField​(String groupMembersField)
      • setGroupSubGroupsField

        public void setGroupSubGroupsField​(String groupSubGroupsField)
      • setGroupParentGroupsField

        public void setGroupParentGroupsField​(String groupParentGroupsField)
      • areGroupsReadOnly

        public Boolean areGroupsReadOnly()
        Description copied from interface: UserManager
        Returns true is users referential is read only (ie : LDAP) -> can not add users -> can not delete users.
        Specified by:
        areGroupsReadOnly in interface UserManager
      • areUsersReadOnly

        public Boolean areUsersReadOnly()
        Description copied from interface: UserManager
        Returns true is groups referential is read only (ie : LDAP) -> can not add groups -> can not delete groups.
        Specified by:
        areUsersReadOnly in interface UserManager
      • checkUsernamePassword

        public boolean checkUsernamePassword​(String username,
                                             String password)
        Description copied from interface: Authenticator
        Check the password for the given username. Returns true if the username / password pair match, false otherwise.
        Specified by:
        checkUsernamePassword in interface Authenticator
        Specified by:
        checkUsernamePassword in interface UserManager
        Parameters:
        username - the username
        password - the password to check
        Returns:
        true is valid, false otherwise
      • getGroupsInGroup

        public List<String> getGroupsInGroup​(String parentId)
        Description copied from interface: UserManager
        Returns the list of groups that belong to this group.
        Specified by:
        getGroupsInGroup in interface UserManager
        Parameters:
        parentId - the name of the parent group.
      • getPrincipal

        public NuxeoPrincipal getPrincipal​(String username,
                                           boolean fetchReferences)
        Description copied from interface: UserManager
        Retrieves the principal with the given username or null if it does not exist.

        Can build principals for anonymous and virtual users as well as for users defined in the users directory.

        Specified by:
        getPrincipal in interface UserManager
        Parameters:
        username - is the name of the entry in the user directory
        fetchReferences - controls if the references (groups) of the user will be fetched
      • getUsersInGroup

        public List<String> getUsersInGroup​(String groupId)
        Description copied from interface: UserManager
        Returns the list of users that belong to this group.
        Specified by:
        getUsersInGroup in interface UserManager
        Parameters:
        groupId - ID of the group
      • setUserPasswordPattern

        public void setUserPasswordPattern​(Pattern userPasswordPattern)
      • setAnonymousUser

        public void setAnonymousUser​(VirtualUser anonymousUser)
      • getAnonymousUserId

        public String getAnonymousUserId()
        Description copied from interface: UserManager
        Gets the anonymous user id.
        Specified by:
        getAnonymousUserId in interface UserManager
        Returns:
        the anonymous user id, or the default one if none is defined.
      • setConfiguration

        public void setConfiguration​(UserManagerDescriptor descriptor)
        Description copied from interface: UserManager
        Sets the given configuration on the service.
        Specified by:
        setConfiguration in interface UserManager
        Parameters:
        descriptor - the descriptor as parsed from xml, merged from the previous one if it exists.
      • searchGroups

        public DocumentModelList searchGroups​(QueryBuilder queryBuilder)
        Description copied from interface: UserManager
        Returns groups matching the given query.
        Specified by:
        searchGroups in interface UserManager
        Parameters:
        queryBuilder - the query to use, including limit, offset, ordering and countTotal
      • searchUsers

        public DocumentModelList searchUsers​(String pattern)
        Description copied from interface: UserManager
        Returns users matching given pattern

        Pattern is used to fill a filter and fulltext map according to users search fields configuration. Search is performed on each of these fields (OR).

        Specified by:
        searchUsers in interface UserManager
      • searchUsers

        public DocumentModelList searchUsers​(QueryBuilder queryBuilder)
        Description copied from interface: UserManager
        Returns users matching the given query.
        Specified by:
        searchUsers in interface UserManager
        Parameters:
        queryBuilder - the query to use, including limit, offset, ordering and countTotal
      • getGroupModel

        public DocumentModel getGroupModel​(String groupName)
        Description copied from interface: UserManager
        Return the group document model with this id or null if group does not exist.
        Specified by:
        getGroupModel in interface UserManager
        Parameters:
        groupName - the group identifier
      • getUsersForPermission

        public String[] getUsersForPermission​(String perm,
                                              ACP acp)
        Description copied from interface: UserManager
        For an ACP, get the list of user that has a permission. This method should be use with care as it can cause performance issues while getting the list of users.
        Specified by:
        getUsersForPermission in interface UserManager
        Parameters:
        perm - the permission
        acp - The access control policy of the document
        Returns:
        the list of user ids
      • authenticate

        public Principal authenticate​(String name,
                                      String password)
        Description copied from interface: Authenticator
        Get a principal object for the given username if the username / password pair is valid, otherwise returns null.

        This method is doing the authentication of the given username / password pair and returns the corresponding principal object if authentication succeeded otherwise returns null.

        Specified by:
        authenticate in interface Authenticator
        Returns:
        the authenticated principal if authentication succeded otherwise null
      • notifyUserChanged

        public void notifyUserChanged​(String userName,
                                      String eventId)
        Description copied from interface: UserManager
        Notifies that the given user has changed with the given event:
        • At the runtime level so that the JaasCacheFlusher listener can make sure the principal cache is reset.
        • At the core level, passing the userName as the "id" property of the fired event.
        Specified by:
        notifyUserChanged in interface UserManager
      • notifyGroupChanged

        public void notifyGroupChanged​(String groupName,
                                       String eventId,
                                       List<String> ancestorGroupNames)
        Description copied from interface: UserManager
        Notifies that the given group has changed with the given event:
        • At the runtime level so that the JaasCacheFlusher listener can make sure the principal cache is reset.
        • At the core level, passing the groupName as the "id" property of the fired event.

        The ancestorGroupNames list must contain the ancestor groups of the given group. It can be computed by calling UserManager.getAncestorGroups(String). It will be passed as the "ancestorGroups" property of the fired core event.

        Specified by:
        notifyGroupChanged in interface UserManager