Move GroupMembers binding to GerritGlobalModule

The only request-scoped variable this needs is the current user, which
can be injected in the factory. Not requiring request scope means it
can now be used by new REST API handlers.

Change-Id: I033586f2234b88139e62a6288097dc7099bd0fcf
This commit is contained in:
Dave Borowitz
2013-02-14 08:23:42 -08:00
committed by Gerrit Code Review
parent 9bdb1bee26
commit d386499438
6 changed files with 15 additions and 10 deletions

View File

@@ -129,8 +129,8 @@ public class AddReviewer implements Callable<ReviewerResult> {
continue;
}
final Set<Account> members =
groupMembersFactory.create().listAccounts(group.getGroupUUID(),
final Set<Account> members = groupMembersFactory.create(currentUser)
.listAccounts(group.getGroupUUID(),
control.getProject().getNameKey());
if (members == null || members.size() == 0) {
result.addError(new ReviewerResult.Error(