@Named public class GroupsController extends AbstractResourceController
Constructor and Description |
---|
GroupsController(ApplicationService applicationService,
AuthenticatedApplicationHolder authenticatedApplicationHolder) |
Modifier and Type | Method and Description |
---|---|
void |
addDirectChildGroup(String groupName,
String childGroupName)
Adds a direct child group membership.
|
void |
addDirectParentGroup(String groupName,
String parentGroupName)
Adds a direct parent group membership.
|
void |
addDirectUser(String groupName,
String username)
Adds user as direct member of group.
|
GroupEntity |
addGroup(GroupEntity group,
com.atlassian.plugins.rest.common.Link groupLink)
Adds a new group.
|
void |
deleteDirectChildGroup(String groupName,
String childGroupName)
Deletes a child group membership.
|
void |
deleteDirectUser(String groupName,
String username)
Removes the user membership.
|
GroupEntity |
findGroupByName(String name,
boolean expandAttributes,
URI baseURI)
Returns the group specified by the name.
|
GroupEntity |
getDirectChildGroup(String groupName,
String childGroupName,
URI baseUri)
Retrieves the group that is a direct child of the specified group.
|
GroupEntityList |
getDirectChildGroups(String groupName,
boolean expandGroups,
int maxResults,
int startIndex,
URI baseUri)
Retrieves the groups that are direct members of the specified group.
|
GroupEntity |
getDirectParentGroup(String groupName,
String parentGroupName,
URI baseUri)
Retrieves the group that is a direct parent of the specified group.
|
GroupEntityList |
getDirectParentGroups(String groupName,
boolean expandGroups,
int maxResults,
int startIndex,
URI baseUri)
Retrieves the groups that are direct parents of the specified group.
|
UserEntity |
getDirectUser(String groupName,
String username,
URI baseUri)
Retrieves the user that is a direct member of the specified group.
|
UserEntityList |
getDirectUsers(String groupName,
boolean expandUsers,
int maxResults,
int startIndex,
URI baseUri)
Retrieves the users that are direct members of the specified group.
|
GroupEntity |
getNestedChildGroup(String groupName,
String childGroupName,
URI baseUri)
Retrieves the group that is a nested child of the specified group.
|
GroupEntityList |
getNestedChildGroups(String groupName,
boolean expandGroups,
int maxResults,
int startIndex,
URI baseUri)
Retrieves the groups that are nested children of the specified group.
|
GroupEntity |
getNestedParentGroup(String groupName,
String parentGroupName,
URI baseUri)
Retrieves the group that is a nested parent of the specified group.
|
GroupEntityList |
getNestedParentGroups(String groupName,
boolean expandGroups,
int maxResults,
int startIndex,
URI baseUri)
Retrieves the groups that are nested parents of the specified group.
|
UserEntity |
getNestedUser(String groupName,
String username,
URI baseUri)
Retrieves the user that is a nested member of the specified group.
|
UserEntityList |
getNestedUsers(String groupName,
boolean expandUsers,
int maxResults,
int startIndex,
URI baseUri)
Retrieves the users that are nested members of the specified group.
|
void |
removeGroup(String groupName)
Removes a group.
|
void |
removeGroupAttributes(String groupName,
String attributeName)
Removes a group's attribute.
|
void |
storeGroupAttributes(String groupName,
MultiValuedAttributeEntityList attributes)
Stores the attributes for a group.
|
GroupEntity |
updateGroup(GroupEntity group,
URI baseURI)
Updates a group.
|
getAuthenticatedApplication
@Inject public GroupsController(ApplicationService applicationService, AuthenticatedApplicationHolder authenticatedApplicationHolder)
public GroupEntity findGroupByName(String name, boolean expandAttributes, URI baseURI) throws GroupNotFoundException
name
- name of the group to returnexpandAttributes
- should attributes be expandedbaseURI
- base URIGroupNotFoundException
public GroupEntity addGroup(GroupEntity group, com.atlassian.plugins.rest.common.Link groupLink) throws ApplicationPermissionException, OperationFailedException, InvalidGroupException, GroupNotFoundException
group
- group to addApplicationPermissionException
- if none of the application's underlying directories are allowed to create
a groupOperationFailedException
- if the operation failed for any other reasonInvalidGroupException
GroupNotFoundException
public GroupEntity updateGroup(GroupEntity group, URI baseURI) throws ApplicationPermissionException, OperationFailedException, InvalidGroupException, GroupNotFoundException
group
- group to updatebaseURI
- base URIInvalidGroupException
- if the group already exists in ANY associated directory or the group template does not have the required properties populated.OperationFailedException
- underlying directory implementation failed to execute the operation.ApplicationPermissionException
- if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP
.GroupNotFoundException
- group does not exist in any of the associated directories of the application.public void removeGroup(String groupName) throws ApplicationPermissionException, OperationFailedException, GroupNotFoundException
groupName
- name of the groupOperationFailedException
- underlying directory implementation failed to execute the operation.GroupNotFoundException
- if group with given name does not exist in ANY assigned directory.ApplicationPermissionException
- if none of the application's associated directories are allowed to perform operations of type OperationType.DELETE_GROUP
.public void storeGroupAttributes(String groupName, MultiValuedAttributeEntityList attributes) throws ApplicationPermissionException, OperationFailedException, GroupNotFoundException
groupName
- name of the groupattributes
- attributes to add/updateGroupNotFoundException
- if the group with the supplied groupname does not exist in ANY assigned directory.OperationFailedException
- underlying directory implementation failed to execute the operation.ApplicationPermissionException
- if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP_ATTRIBUTE
.public void removeGroupAttributes(String groupName, String attributeName) throws ApplicationPermissionException, OperationFailedException, GroupNotFoundException
groupName
- name of the groupattributeName
- attribute to removeGroupNotFoundException
- if the group with the supplied groupname does not exist in ANY assigned directory.OperationFailedException
- underlying directory implementation failed to execute the operation.ApplicationPermissionException
- if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP_ATTRIBUTE
.public UserEntityList getDirectUsers(String groupName, boolean expandUsers, int maxResults, int startIndex, URI baseUri) throws GroupNotFoundException
groupName
- name of the groupexpandUsers
- should users be expandedmaxResults
- maximum number of results returned. If -1, then all the results are returned.startIndex
- starting index of the resultsbaseUri
- base URIGroupNotFoundException
public void addDirectUser(String groupName, String username) throws ApplicationPermissionException, UserNotFoundException, GroupNotFoundException, OperationFailedException, MembershipAlreadyExistsException
groupName
- name of the groupusername
- name of the child groupApplicationPermissionException
- if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP
.MembershipAlreadyExistsException
- if the user is already a member of the groupUserNotFoundException
GroupNotFoundException
OperationFailedException
public UserEntity getDirectUser(String groupName, String username, URI baseUri) throws MembershipNotFoundException, GroupNotFoundException
groupName
- name of the groupusername
- name of the child groupbaseUri
- base URIMembershipNotFoundException
GroupNotFoundException
public void deleteDirectUser(String groupName, String username) throws ApplicationPermissionException, MembershipNotFoundException, UserNotFoundException, GroupNotFoundException, OperationFailedException
groupName
- name of the groupusername
- name of the userApplicationPermissionException
- if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP
.MembershipNotFoundException
UserNotFoundException
GroupNotFoundException
OperationFailedException
public UserEntityList getNestedUsers(String groupName, boolean expandUsers, int maxResults, int startIndex, URI baseUri) throws GroupNotFoundException
groupName
- name of the groupexpandUsers
- should groups be expandedmaxResults
- maximum number of results returned. If -1, then all the results are returned.startIndex
- starting index of the resultsbaseUri
- base URIGroupNotFoundException
public UserEntity getNestedUser(String groupName, String username, URI baseUri) throws MembershipNotFoundException, GroupNotFoundException
groupName
- name of the groupusername
- name of the userbaseUri
- base URIMembershipNotFoundException
GroupNotFoundException
public GroupEntityList getDirectParentGroups(String groupName, boolean expandGroups, int maxResults, int startIndex, URI baseUri)
groupName
- name of the groupexpandGroups
- should groups be expandedmaxResults
- maximum number of results returned. If -1, then all the results are returned.startIndex
- starting index of the resultsbaseUri
- base URIpublic void addDirectParentGroup(String groupName, String parentGroupName) throws ApplicationPermissionException, InvalidMembershipException, GroupNotFoundException, OperationFailedException, MembershipAlreadyExistsException
groupName
- name of the groupparentGroupName
- name of the parent groupApplicationPermissionException
- if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP
.MembershipAlreadyExistsException
- if the child group is already a child of the parent groupInvalidMembershipException
GroupNotFoundException
OperationFailedException
public GroupEntity getDirectParentGroup(String groupName, String parentGroupName, URI baseUri) throws MembershipNotFoundException
groupName
- name of the groupparentGroupName
- name of the parent groupbaseUri
- base URIMembershipNotFoundException
public GroupEntityList getNestedParentGroups(String groupName, boolean expandGroups, int maxResults, int startIndex, URI baseUri)
groupName
- name of the groupexpandGroups
- should groups be expandedmaxResults
- maximum number of results returned. If -1, then all the results are returned.startIndex
- starting index of the resultsbaseUri
- base URIpublic GroupEntity getNestedParentGroup(String groupName, String parentGroupName, URI baseUri) throws MembershipNotFoundException
groupName
- name of the groupparentGroupName
- name of the parent groupbaseUri
- base URIMembershipNotFoundException
public GroupEntityList getDirectChildGroups(String groupName, boolean expandGroups, int maxResults, int startIndex, URI baseUri)
groupName
- name of the groupexpandGroups
- should groups be expandedmaxResults
- maximum number of results returned. If -1, then all the results are returned.startIndex
- starting index of the resultsbaseUri
- base URIpublic void addDirectChildGroup(String groupName, String childGroupName) throws ApplicationPermissionException, InvalidMembershipException, GroupNotFoundException, OperationFailedException, MembershipAlreadyExistsException
groupName
- name of the groupchildGroupName
- name of the child groupMembershipAlreadyExistsException
- if the child group is already a child of the parent groupApplicationPermissionException
- if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP
.InvalidMembershipException
GroupNotFoundException
OperationFailedException
public GroupEntity getDirectChildGroup(String groupName, String childGroupName, URI baseUri) throws MembershipNotFoundException
groupName
- name of the groupchildGroupName
- name of the child groupbaseUri
- base URIMembershipNotFoundException
public void deleteDirectChildGroup(String groupName, String childGroupName) throws ApplicationPermissionException, MembershipNotFoundException, GroupNotFoundException, OperationFailedException
groupName
- name of the groupchildGroupName
- name of the child groupApplicationPermissionException
- if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP
.MembershipNotFoundException
GroupNotFoundException
OperationFailedException
public GroupEntityList getNestedChildGroups(String groupName, boolean expandGroups, int maxResults, int startIndex, URI baseUri)
groupName
- name of the groupexpandGroups
- should groups be expandedmaxResults
- maximum number of results returned. If -1, then all the results are returned.startIndex
- starting index of the resultsbaseUri
- base URIpublic GroupEntity getNestedChildGroup(String groupName, String childGroupName, URI baseUri) throws MembershipNotFoundException
groupName
- name of the groupchildGroupName
- name of the child groupbaseUri
- base URIMembershipNotFoundException
Copyright © 2021 Atlassian. All rights reserved.