Class UserGroup
java.lang.Object
io.goobi.viewer.model.security.user.AbstractLicensee
io.goobi.viewer.model.security.user.UserGroup
- All Implemented Interfaces:
ILicensee,Serializable
Represents a group of users that can be assigned licences and roles collectively.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds membership relation between the given user and role and persists immediately.booleanchangeMemberRole(User user, Role role) changeMemberRole.booleanGetter for the fielddescription.getId()Getter for the fieldid.longgetMembers.getMemberships.getName()getName.getOwner()Getter for the fieldowner.inthashCode()booleanhasUserPrivilege(String privilegeName) hasUserPrivilege.booleanisActive()isActive.booleanbooleanremoveMember(User user) Remove User from Group.voidsetActive(boolean active) Setter for the fieldactive.voidsetDescription(String description) Setter for the fielddescription.voidSetter for the fieldid.voidsetMemberships(List<UserRole> memberships) voidSetter for the fieldname.voidSetter for the fieldowner.toString()Methods inherited from class io.goobi.viewer.model.security.user.AbstractLicensee
getAccessPermissionFromMap, getLicenses, hasLicense
-
Constructor Details
-
UserGroup
public UserGroup()
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
addMember
Adds membership relation between the given user and role and persists immediately.- Parameters:
user- User to addrole- Role to add- Returns:
- true if persistence successful, false otherwise
- Throws:
PresentationException- if any.DAOException- if any.
-
changeMemberRole
changeMemberRole.- Parameters:
user- user whose role to update in this grouprole- new role to assign to the user- Returns:
- true if the role was changed successfully (i.e. both user and role are non-null), false otherwise
-
removeMember
Remove User from Group.- Parameters:
user- user to remove from this group- Returns:
- true if the user was removed (i.e. the user argument is non-null), false otherwise
- Throws:
DAOException- if any.
-
hasUserPrivilege
hasUserPrivilege.- Parameters:
privilegeName- name of the privilege to check- Returns:
- true if any member role of this group grants the given privilege, false otherwise
- Throws:
DAOException- if any.
-
getId
Getter for the fieldid.- Returns:
- the database identifier of this user group
-
setId
Setter for the fieldid.- Parameters:
id- the database identifier to set
-
getName
getName. -
setName
Setter for the fieldname.- Parameters:
name- the display name of this user group to set
-
getDescription
Getter for the fielddescription.- Returns:
- a human-readable description of this user group
-
setDescription
Setter for the fielddescription.- Parameters:
description- a human-readable description of this user group to set
-
getAccessType
- Specified by:
getAccessTypein interfaceILicensee- Returns:
- AccessType corresponding to the licensee's class
-
getOwner
Getter for the fieldowner.- Returns:
- the user who owns this group
-
setOwner
Setter for the fieldowner.- Parameters:
owner- the user who owns this group to set
-
isActive
public boolean isActive()isActive.- Returns:
- true if this user group is active, false otherwise
-
setActive
public void setActive(boolean active) Setter for the fieldactive.- Parameters:
active- true if this user group is active; false otherwise
-
isHasMembers
- Returns:
- true if group has members other than the owner; false otherwise
- Throws:
DAOException
-
getMemberCount
- Returns:
- number of members in this group
- Throws:
DAOException
-
getMemberships
getMemberships.- Returns:
- a list of user role entries representing the members of this group
- Throws:
DAOException- if any.
-
setMemberships
-
getMembers
getMembers.- Returns:
- the set of all users that are members of this group
- Throws:
DAOException- if any.
-
getMembersAndOwner
- Returns:
- Set
- Throws:
DAOException
-
toString
-