Class MemoryUser

    • Method Detail

      • addGroup

        public void addGroup​(Group group)
        Add a new Group to those this user belongs to.
        Specified by:
        addGroup in interface User
        Specified by:
        addGroup in class AbstractUser
        Parameters:
        group - The new group
      • addRole

        public void addRole​(Role role)
        Add a new Role to those assigned specifically to this user.
        Specified by:
        addRole in interface User
        Specified by:
        addRole in class AbstractUser
        Parameters:
        role - The new role
      • isInGroup

        public boolean isInGroup​(Group group)
        Is this user in the specified group?
        Specified by:
        isInGroup in interface User
        Specified by:
        isInGroup in class AbstractUser
        Parameters:
        group - The group to check
        Returns:
        true if the user is in the specified group
      • isInRole

        public boolean isInRole​(Role role)
        Is this user specifically assigned the specified Role? This method does NOT check for roles inherited based on Group membership.
        Specified by:
        isInRole in interface User
        Specified by:
        isInRole in class AbstractUser
        Parameters:
        role - The role to check
        Returns:
        true if the user has the specified role
      • removeRole

        public void removeRole​(Role role)
        Remove a Role from those assigned to this user.
        Specified by:
        removeRole in interface User
        Specified by:
        removeRole in class AbstractUser
        Parameters:
        role - The old role
      • toXml

        public String toXml()

        Return a String representation of this user in XML format.

        IMPLEMENTATION NOTE - For backwards compatibility, the reader that processes this entry will accept either username or name for the username property.

        Returns:
        the XML representation