aboutsummaryrefslogtreecommitdiffstats
path: root/it/it-plugins
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2017-04-26 17:39:39 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2017-04-28 18:36:09 +0200
commit1eed5d9bfbf46bc9ffc0b7d7673a3beaf2b9c9a6 (patch)
tree7a82522f797e90166f0796012b04e563886f7be1 /it/it-plugins
parentce8280033755911dad0766d342d36f442789ed26 (diff)
downloadsonarqube-1eed5d9bfbf46bc9ffc0b7d7673a3beaf2b9c9a6.tar.gz
sonarqube-1eed5d9bfbf46bc9ffc0b7d7673a3beaf2b9c9a6.zip
SONAR-9121 Add a flag in api/navigation/organization to know if projects can become private
Diffstat (limited to 'it/it-plugins')
-rw-r--r--it/it-plugins/billing-plugin/src/main/java/BillingValidations.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/it/it-plugins/billing-plugin/src/main/java/BillingValidations.java b/it/it-plugins/billing-plugin/src/main/java/BillingValidations.java
index b21d9c64837..344f24925fd 100644
--- a/it/it-plugins/billing-plugin/src/main/java/BillingValidations.java
+++ b/it/it-plugins/billing-plugin/src/main/java/BillingValidations.java
@@ -27,6 +27,7 @@ import static java.lang.String.format;
public class BillingValidations implements BillingValidationsExtension {
private static final String PREVENT_PROJECT_ANALYSIS_SETTING = "sonar.billing.preventProjectAnalysis";
+ private static final String PREVENT_UPDATING_PROJECTS_VISIBILITY_TO_PRIVATE_SETTING = "sonar.billing.preventUpdatingProjectsVisibilityToPrivate";
private final Settings settings;
@@ -41,4 +42,12 @@ public class BillingValidations implements BillingValidationsExtension {
throw new BillingValidationsException(format("Organization %s cannot perform analysis", organization.getKey()));
}
}
+
+ @Override
+ public boolean canUpdateProjectVisibilityToPrivate(Organization organization) {
+ if (!settings.hasKey(PREVENT_UPDATING_PROJECTS_VISIBILITY_TO_PRIVATE_SETTING)) {
+ return true;
+ }
+ return !settings.getBoolean(PREVENT_UPDATING_PROJECTS_VISIBILITY_TO_PRIVATE_SETTING);
+ }
}