Ignore non-visible included groups when listing members recursively

When the members of a group are listed via REST with the 'recursive'
option ignore those included groups which are not visible to the
calling user. This is better than failing completely as we do
currently and is consistent with how included external groups are
handled (they are also ignored).

Change-Id: I02b2213573b2647582bddcdcab374c672308bc89
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2013-03-08 16:37:14 +01:00
parent 5aef4f3614
commit d54de1cbb6
11 changed files with 40 additions and 51 deletions

View File

@@ -19,7 +19,6 @@ 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;
import com.google.gerrit.reviewdb.server.ReviewDb;
@@ -52,7 +51,7 @@ public class ListIncludedGroups implements RestReadView<GroupResource> {
@Override
public List<GroupInfo> apply(GroupResource rsrc)
throws MethodNotAllowedException, ResourceNotFoundException, OrmException {
throws MethodNotAllowedException, OrmException {
if (rsrc.toAccountGroup() == null) {
throw new MethodNotAllowedException();
}