Class UserGroup

java.lang.Object
io.goobi.viewer.model.security.user.AbstractLicensee
io.goobi.viewer.model.security.user.UserGroup
All Implemented Interfaces:
ILicensee, Serializable

@Entity public class UserGroup extends AbstractLicensee implements Serializable

UserGroup class.

See Also:
  • Constructor Details

    • UserGroup

      public UserGroup()
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • addMember

      public boolean addMember(User user, Role role) throws PresentationException, DAOException
      Adds membership relation between the given user and role and persists immediately.
      Parameters:
      user - User to add
      role - Role to add
      Returns:
      true if persistence successful, false otherwise
      Throws:
      PresentationException - if any.
      DAOException - if any.
    • changeMemberRole

      public boolean changeMemberRole(User user, Role role)

      changeMemberRole.

      Parameters:
      user - a User object.
      role - a Role object.
      Returns:
      a boolean.
    • removeMember

      public boolean removeMember(User user) throws DAOException
      remove User from Group
      Parameters:
      user - a User object.
      Returns:
      a boolean.
      Throws:
      DAOException - if any.
    • hasUserPrivilege

      public boolean hasUserPrivilege(String privilegeName) throws DAOException

      hasUserPrivilege.

      Parameters:
      privilegeName - a String object.
      Returns:
      a boolean.
      Throws:
      DAOException - if any.
    • addLicense

      public boolean addLicense(License license)
      Adds the given license to this ILicensee.
      Specified by:
      addLicense in interface ILicensee
      Parameters:
      license - a License object.
      Returns:
      a boolean.
    • removeLicense

      public boolean removeLicense(License license)
      Removes the given license from this ILicensee.
      Specified by:
      removeLicense in interface ILicensee
      Parameters:
      license - a License object.
      Returns:
      a boolean.
    • getId

      public Long getId()

      Getter for the field id.

      Returns:
      the id
    • setId

      public void setId(Long id)

      Setter for the field id.

      Parameters:
      id - the id to set
    • getName

      public String getName()

      getName.

      Specified by:
      getName in interface ILicensee
      Returns:
      a String object.
    • setName

      public void setName(String name)

      Setter for the field name.

      Parameters:
      name - the name to set
    • getDescription

      public String getDescription()

      Getter for the field description.

      Returns:
      the description
    • setDescription

      public void setDescription(String description)

      Setter for the field description.

      Parameters:
      description - the description to set
    • getOwner

      public User getOwner()

      Getter for the field owner.

      Returns:
      the owner
    • setOwner

      public void setOwner(User owner)

      Setter for the field owner.

      Parameters:
      owner - the owner to set
    • isActive

      public boolean isActive()

      isActive.

      Returns:
      the active
    • setActive

      public void setActive(boolean active)

      Setter for the field active.

      Parameters:
      active - the active to set
    • getLicenses

      public List<License> getLicenses()

      getLicenses.

      Specified by:
      getLicenses in interface ILicensee
      Returns:
      a List object.
    • setLicenses

      public void setLicenses(List<License> licenses)

      Setter for the field licenses.

      Parameters:
      licenses - the licenses to set
    • getLicenses

      public List<License> getLicenses(boolean core)

      Getter for the field licenses.

      Parameters:
      core - a boolean.
      Returns:
      List of filtered licenses whose type's core attribute matches the given value
    • isHasMembers

      public boolean isHasMembers() throws DAOException
      Returns:
      true if group has members other than the owner; false otherwise
      Throws:
      DAOException
    • getMemberCount

      public long getMemberCount() throws DAOException
      Returns:
      number of members in this group
      Throws:
      DAOException
    • getMemberships

      public List<UserRole> getMemberships() throws DAOException

      getMemberships.

      Returns:
      a List object.
      Throws:
      DAOException - if any.
    • setMemberships

      public void setMemberships(List<UserRole> memberships)
      Parameters:
      memberships - the memberships to set
    • getMembers

      public Set<User> getMembers() throws DAOException

      getMembers.

      Returns:
      a Set object.
      Throws:
      DAOException - if any.
    • getMembersAndOwner

      public Set<User> getMembersAndOwner() throws DAOException
      Returns:
      Set
      Throws:
      DAOException
    • toString

      public String toString()
      Overrides:
      toString in class Object