Package org.molgenis.data.security.auth
Class GroupService
- java.lang.Object
-
- org.molgenis.data.security.auth.GroupService
-
@Service public class GroupService extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUTHORITY_EDITORstatic StringAUTHORITY_MANAGERstatic StringAUTHORITY_VIEWERstatic Set<String>DEFAULT_ROLESstatic StringEDITORstatic StringMANAGERstatic StringVIEWER
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMember(Group group, User user, Role role)Add member to group.voiddeleteGroup(String groupName)GroupgetGroup(String groupName)Get the group entity by its unique name.Collection<Group>getGroups()booleanisGroupNameAvailable(GroupValue groupValue)voidpersist(GroupValue groupValue)voidremoveExtendsRole(Group group, Role memberRole)voidremoveMember(Group group, User user)voidupdateExtendsRole(Group group, Role groupRole, Role memberRole)voidupdateMemberRole(Group group, User member, Role newRole)
-
-
-
Field Detail
-
MANAGER
public static final String MANAGER
- See Also:
- Constant Field Values
-
EDITOR
public static final String EDITOR
- See Also:
- Constant Field Values
-
VIEWER
public static final String VIEWER
- See Also:
- Constant Field Values
-
AUTHORITY_MANAGER
public static final String AUTHORITY_MANAGER
-
AUTHORITY_EDITOR
public static final String AUTHORITY_EDITOR
-
AUTHORITY_VIEWER
public static final String AUTHORITY_VIEWER
-
-
Method Detail
-
persist
@Transactional public void persist(GroupValue groupValue)
- Parameters:
groupValue- details of the group that should be created
-
getGroups
public Collection<Group> getGroups()
-
getGroup
public Group getGroup(String groupName)
Get the group entity by its unique name.- Parameters:
groupName- unique group name- Returns:
- group with given name
- Throws:
UnknownEntityException- in case no group with given name can be retrieved
-
addMember
public void addMember(Group group, User user, Role role)
Add member to group. User can only be added to a role that belongs to the group. The user can only have a single role within the group- Parameters:
group- group to add the user to in the given roleuser- user to be added in the given role to the given grouprole- role in which the given user is to be added to given group
-
isGroupNameAvailable
public boolean isGroupNameAvailable(GroupValue groupValue)
-
deleteGroup
public void deleteGroup(String groupName)
-
-