aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-09-29 10:46:08 +0200
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-10-12 10:48:47 +0200
commit82a14b1821cb71d1e51dd493cef9dae586bed24c (patch)
treecfb69b7d7cac3916d2d10f7fe6835319f33156d8
parentad2db520bfeb04abac668b04ee3fb21059446969 (diff)
downloadsonarqube-82a14b1821cb71d1e51dd493cef9dae586bed24c.tar.gz
sonarqube-82a14b1821cb71d1e51dd493cef9dae586bed24c.zip
SONAR-8151 add property sonar.organizations.anyoneCanCreate
-rw-r--r--server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java15
2 files changed, 14 insertions, 3 deletions
diff --git a/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java b/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java
index be36332bd4d..e1a8a4763d3 100644
--- a/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java
+++ b/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java
@@ -108,7 +108,7 @@ public class ComputeEngineContainerImplTest {
+ 24 // level 1
+ 52 // content of DaoModule
+ 2 // content of EsSearchModule
- + 61 // content of CorePropertyDefinitions
+ + 62 // content of CorePropertyDefinitions
+ 1 // content of CePropertyDefinitions
);
assertThat(picoContainer.getParent().getParent().getParent().getParent()).isNull();
diff --git a/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java b/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java
index 982466b9d5c..a91cbb8b361 100644
--- a/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java
+++ b/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java
@@ -47,6 +47,10 @@ public class CorePropertyDefinitions {
private static final String TIMEMACHINE_DEFAULT_PERIOD_4 = "";
private static final String TIMEMACHINE_DEFAULT_PERIOD_5 = "";
+ private static final String CATEGORY_ORGANIZATIONS = "organizations";
+ private static final String ORGANIZATIONS_ANYONE_CAN_CREATE = "sonar.organizations.anyoneCanCreate";
+ private static final boolean ORGANIZATIONS_ANYONE_CAN_CREATE_DEFAULT_VALUE = false;
+
private CorePropertyDefinitions() {
// only static stuff
}
@@ -204,8 +208,7 @@ public class CorePropertyDefinitions {
.type(PropertyType.USER_LOGIN)
.build(),
- // BATCH
-
+ // SCANNER
PropertyDefinition.builder(TIMEMACHINE_PERIOD_PREFIX + 1)
.name("Leak Period")
.description("Period used to compare measures and track new issues. Values are : <ul class='bullet'><li>Number of days before " +
@@ -282,6 +285,14 @@ public class CorePropertyDefinitions {
.category(CoreProperties.CATEGORY_EXCLUSIONS)
.subCategory(CoreProperties.SUBCATEGORY_DUPLICATIONS_EXCLUSIONS)
.multiValues(true)
+ .build(),
+
+ // ORGANIZATIONS
+ PropertyDefinition.builder(ORGANIZATIONS_ANYONE_CAN_CREATE)
+ .name("Allow any authenticated user to create organizations")
+ .defaultValue(Boolean.toString(ORGANIZATIONS_ANYONE_CAN_CREATE_DEFAULT_VALUE))
+ .category(CATEGORY_ORGANIZATIONS)
+ .type(PropertyType.BOOLEAN)
.build()));
return defs;
}