Remove command line reviewer/cc visibility check
This differs from the behavior of %r= in the magic branch or even the new push option support of "-o r=". Drop the visibility check here and just pass down the identities to ReceiveCommits so that behavior is consistent. Change-Id: Iabec4d5c48afd4e820d6bd824c6ae24b0a1e37b5
This commit is contained in:
parent
493be51816
commit
e0774b74d4
@ -49,11 +49,7 @@ final class Receive extends AbstractGitCommand {
|
||||
private static final Logger log = LoggerFactory.getLogger(Receive.class);
|
||||
|
||||
@Inject private AsyncReceiveCommits.Factory factory;
|
||||
|
||||
@Inject private IdentifiedUser currentUser;
|
||||
|
||||
@Inject private IdentifiedUser.GenericFactory identifiedUserFactory;
|
||||
|
||||
@Inject private SshSession session;
|
||||
|
||||
private final Set<Account.Id> reviewerId = new HashSet<>();
|
||||
@ -92,9 +88,6 @@ final class Receive extends AbstractGitCommand {
|
||||
throw die(r.getMessage());
|
||||
}
|
||||
|
||||
verifyProjectVisible("reviewer", reviewerId);
|
||||
verifyProjectVisible("CC", ccId);
|
||||
|
||||
receive.init();
|
||||
receive.addReviewers(reviewerId);
|
||||
receive.addExtraCC(ccId);
|
||||
@ -172,14 +165,4 @@ final class Receive extends AbstractGitCommand {
|
||||
throw new Failure(128, "fatal: Unpack error, check server log", detail);
|
||||
}
|
||||
}
|
||||
|
||||
private void verifyProjectVisible(final String type, final Set<Account.Id> who)
|
||||
throws UnloggedFailure {
|
||||
for (final Account.Id id : who) {
|
||||
final IdentifiedUser user = identifiedUserFactory.create(id);
|
||||
if (!projectControl.forUser(user).isVisible()) {
|
||||
throw die(type + " " + user.getAccount().getFullName() + " cannot access the project");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user