Merge "For external group fail with 405 if group endpoint expects internal group"
This commit is contained in:
@@ -18,6 +18,7 @@ import static com.google.common.base.Strings.nullToEmpty;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.gerrit.common.errors.NoSuchGroupException;
|
||||
import com.google.gerrit.extensions.restapi.MethodNotAllowedException;
|
||||
import com.google.gerrit.extensions.restapi.ResourceNotFoundException;
|
||||
import com.google.gerrit.extensions.restapi.RestReadView;
|
||||
import com.google.gerrit.reviewdb.client.AccountGroupIncludeByUuid;
|
||||
@@ -51,9 +52,9 @@ public class ListIncludedGroups implements RestReadView<GroupResource> {
|
||||
|
||||
@Override
|
||||
public List<GroupInfo> apply(GroupResource rsrc)
|
||||
throws ResourceNotFoundException, OrmException {
|
||||
throws MethodNotAllowedException, ResourceNotFoundException, OrmException {
|
||||
if (rsrc.toAccountGroup() == null) {
|
||||
throw new ResourceNotFoundException(rsrc.getGroupUUID().get());
|
||||
throw new MethodNotAllowedException();
|
||||
}
|
||||
|
||||
boolean ownerOfParent = rsrc.getControl().isOwner();
|
||||
|
@@ -20,6 +20,7 @@ import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Ordering;
|
||||
import com.google.gerrit.common.data.GroupDetail;
|
||||
import com.google.gerrit.common.errors.NoSuchGroupException;
|
||||
import com.google.gerrit.extensions.restapi.MethodNotAllowedException;
|
||||
import com.google.gerrit.extensions.restapi.ResourceNotFoundException;
|
||||
import com.google.gerrit.extensions.restapi.RestReadView;
|
||||
import com.google.gerrit.reviewdb.client.Account;
|
||||
@@ -59,9 +60,9 @@ public class ListMembers implements RestReadView<GroupResource> {
|
||||
|
||||
@Override
|
||||
public List<AccountInfo> apply(final GroupResource resource)
|
||||
throws ResourceNotFoundException, OrmException {
|
||||
throws MethodNotAllowedException, ResourceNotFoundException, OrmException {
|
||||
if (resource.toAccountGroup() == null) {
|
||||
throw new ResourceNotFoundException(resource.getGroupUUID().get());
|
||||
throw new MethodNotAllowedException();
|
||||
}
|
||||
try {
|
||||
final Map<Account.Id, AccountInfo> members =
|
||||
|
Reference in New Issue
Block a user