Package io.goobi.viewer.managedbeans
Class UserGroupBean
java.lang.Object
io.goobi.viewer.managedbeans.UserGroupBean
- All Implemented Interfaces:
Serializable
JSF backing bean for managing user groups and their members in the admin interface.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDeletes currentUserGroup.Returns a list of all existing roles (minus superuser).Used for the 'add member' selectbox.Getter for the fieldcurrentMember.Getter for the fieldcurrentOtherUserGroup.Getter for the fieldcurrentOwnUserGroup.intGetter for the fieldcurrentOwnUserGroupId.Getter for the fieldcurrentRole.Returns the names all users that are not already members of the currently selected user group.voidinit()init.booleanisNewUserGroup.voidRevokes the current user's membership in currentOtherUserGroup.voidmemberSelectedAction.voidRemoves currentMember from the member list of currentUserGroup.final voidSets currentUserGroup to a new object.voidsaveCurrentOwnUserGroupAction(ActionEvent actionEvent) Creates or updates (if already exists) currentOwnUserGroup.voidsetCurrentId(Long id) Used for the 'add member' selectbox.voidsetCurrentMember(User currentMember) Setter for the fieldcurrentMember.voidsetCurrentOtherUserGroup(UserGroup currentOtherUserGroup) Setter for the fieldcurrentOtherUserGroup.voidSetter for the fieldcurrentOwnUserGroup.voidsetCurrentOwnUserGroup(UserGroup currentOwnUserGroup) Setter for the fieldcurrentOwnUserGroup.voidsetCurrentOwnUserGroupId(int currentOwnUserGroupId) Setter for the fieldcurrentOwnUserGroupId.voidsetCurrentRole(Role currentRole) Setter for the fieldcurrentRole.
-
Constructor Details
-
UserGroupBean
public UserGroupBean()Empty constructor.
-
-
Method Details
-
init
init. -
saveCurrentOwnUserGroupAction
Creates or updates (if already exists) currentOwnUserGroup.- Parameters:
actionEvent- JSF action event triggering the save- Throws:
DAOException- if any.
-
deleteCurrentUserGroupAction
Deletes currentUserGroup. TODO Some sort of confirmation dialog- Throws:
DAOException- if any.
-
leaveCurrentUserGroupAction
Revokes the current user's membership in currentOtherUserGroup. TODO Some sort of confirmation dialog- Throws:
DAOException- if any.
-
resetCurrentUserGroupAction
public final void resetCurrentUserGroupAction()Sets currentUserGroup to a new object. -
removeCurrentMemberAction
Removes currentMember from the member list of currentUserGroup.- Throws:
DAOException- if any.
-
getRemainingUsers
Returns the names all users that are not already members of the currently selected user group. TODO Filter some user groups, if required (e.g.admins)
- Returns:
- a list of select items representing users not yet members of the current user group
- Throws:
DAOException- if any.
-
memberSelectedAction
memberSelectedAction.- Parameters:
event-ValueChangeEvent
-
getAllRoles
Returns a list of all existing roles (minus superuser).- Returns:
- a list of all roles in the database excluding the superuser role
- Throws:
DAOException- if any.
-
getCurrentOtherUserGroup
Getter for the fieldcurrentOtherUserGroup.- Returns:
- the user group the current user may join or leave
-
setCurrentOtherUserGroup
Setter for the fieldcurrentOtherUserGroup.- Parameters:
currentOtherUserGroup- user group the current user may join or leave
-
getCurrentOwnUserGroupId
public int getCurrentOwnUserGroupId()Getter for the fieldcurrentOwnUserGroupId.- Returns:
- the database ID of the user group owned by the current user that is currently selected
-
setCurrentOwnUserGroupId
public void setCurrentOwnUserGroupId(int currentOwnUserGroupId) Setter for the fieldcurrentOwnUserGroupId.- Parameters:
currentOwnUserGroupId- database ID of the group to select
-
getCurrentOwnUserGroup
Getter for the fieldcurrentOwnUserGroup.- Returns:
- the user group owned by the current user that is currently selected for editing
-
setCurrentOwnUserGroup
Setter for the fieldcurrentOwnUserGroup.- Parameters:
currentOwnUserGroup- user group owned by the current user to edit
-
setCurrentOwnUserGroup
Setter for the fieldcurrentOwnUserGroup.- Throws:
DAOException- if any.
-
getCurrentMember
Getter for the fieldcurrentMember.- Returns:
- the group member currently selected for removal
-
setCurrentMember
Setter for the fieldcurrentMember.- Parameters:
currentMember- group member selected for removal
-
getCurrentRole
Getter for the fieldcurrentRole.- Returns:
- the role to assign to the selected group member
-
setCurrentRole
Setter for the fieldcurrentRole.- Parameters:
currentRole- role to assign to the selected member
-
getCurrentId
Used for the 'add member' selectbox.- Returns:
- always -1L, used as a sentinel value for the member selection UI
-
setCurrentId
Used for the 'add member' selectbox.- Parameters:
id- database ID of the user to add as member- Throws:
DAOException- if any.
-
isNewUserGroup
public boolean isNewUserGroup()isNewUserGroup.- Returns:
- true if the current user group has not yet been saved (i.e. has no name assigned), false otherwise
-