Allow contributor agreements to be optional

By default the contributor agreements are disabled, as there are
no agreements in the database.  Admins which require agreements
must enable them in system_config.

This permits friendly community installations, such as a corporate
location, where access automatically implies agreement to contribute
because it is work-for-hire.

Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2009-01-06 17:00:51 -08:00
parent 5c22bd5bdf
commit 1ae09f8f98
5 changed files with 27 additions and 8 deletions

View File

@@ -278,6 +278,7 @@ public class GerritServer {
final GerritConfig r = new GerritConfig();
r.setCanonicalUrl(getCanonicalURL());
r.setSshdPort(sConfig.sshdPort);
r.setUseContributorAgreements(sConfig.useContributorAgreements);
if (sConfig.gitwebUrl != null) {
r.setGitwebLink(new GitwebLink(sConfig.gitwebUrl));
}

View File

@@ -89,7 +89,9 @@ class Receive extends AbstractGitCommand {
@Override
protected void runImpl() throws IOException, Failure {
server = getGerritServer();
verifyActiveContributorAgreement();
if (Common.getGerritConfig().isUseContributorAgreements()) {
verifyActiveContributorAgreement();
}
loadMyEmails();
lookup(reviewerId, "reviewer", reviewerEmail);
lookup(ccId, "cc", ccEmail);