Add REST endpoints to retrieve group members and included groups
The '/groups/*/members/' REST endpoint lists the members of a group. Information for a certain member can be accessed by '/groups/*/members/<account-id>'. The '/groups/*/groups/' REST endpoint lists the included groups of a group. Information for a certain included group can be accessed by '/groups/*/groups/uuid-<group-uuid>' or '/groups/*/groups/<group-id>'. Having seperate REST endpoints for members and included groups makes it easy to add support for adding/deleting members/included groups later. It is not possible yet to list members/included groups of system groups such as 'Project Owners', 'Registered Users' etc. Support for resolving system groups will be added later. Change-Id: Iea45f41d2b64927179cebd897aced619c5b9cd04 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
@@ -28,7 +28,7 @@ public class AccountResource implements RestResource {
|
||||
|
||||
private final IdentifiedUser user;
|
||||
|
||||
AccountResource(IdentifiedUser user) {
|
||||
public AccountResource(IdentifiedUser user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,15 @@ public class GroupControl {
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
public GroupControl validateFor(final AccountGroup.UUID groupUUID)
|
||||
throws NoSuchGroupException {
|
||||
final GroupControl c = controlFor(groupUUID);
|
||||
if (!c.isVisible()) {
|
||||
throw new NoSuchGroupException(groupUUID);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
}
|
||||
|
||||
private final CurrentUser user;
|
||||
|
||||
Reference in New Issue
Block a user