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:
Edwin Kempin
2013-01-09 17:28:14 +01:00
parent 34fbcc1fa8
commit 4fc0920c45
16 changed files with 543 additions and 7 deletions

View File

@@ -28,7 +28,7 @@ public class AccountResource implements RestResource {
private final IdentifiedUser user;
AccountResource(IdentifiedUser user) {
public AccountResource(IdentifiedUser user) {
this.user = user;
}

View File

@@ -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;