aboutsummaryrefslogtreecommitdiffstats
path: root/it/it-plugins
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2017-04-27 14:56:39 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2017-04-28 18:36:09 +0200
commit8d3eac2ec8afe884fdae95dffa96bcda23048d42 (patch)
treee28bf2351de9abe0b3286033682858dd6267292a /it/it-plugins
parentfdfa49be4133e34b6bb5849a137166eb29bf9109 (diff)
downloadsonarqube-8d3eac2ec8afe884fdae95dffa96bcda23048d42.tar.gz
sonarqube-8d3eac2ec8afe884fdae95dffa96bcda23048d42.zip
SONAR-9125 Allow preventing organizations to use private projects in api/organizations/update_project_visibility
Diffstat (limited to 'it/it-plugins')
-rw-r--r--it/it-plugins/billing-plugin/src/main/java/BillingValidations.java8
1 files changed, 8 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 344f24925fd..0e57d8d305d 100644
--- a/it/it-plugins/billing-plugin/src/main/java/BillingValidations.java
+++ b/it/it-plugins/billing-plugin/src/main/java/BillingValidations.java
@@ -44,6 +44,14 @@ public class BillingValidations implements BillingValidationsExtension {
}
@Override
+ public void checkCanUpdateProjectVisibility(Organization organization, boolean updateToPrivate) {
+ boolean preventUpdatingProjectsToPrivate = settings.getBoolean(PREVENT_UPDATING_PROJECTS_VISIBILITY_TO_PRIVATE_SETTING);
+ if (preventUpdatingProjectsToPrivate) {
+ throw new BillingValidationsException(format("Organization %s cannot use private project", organization.getKey()));
+ }
+ }
+
+ @Override
public boolean canUpdateProjectVisibilityToPrivate(Organization organization) {
if (!settings.hasKey(PREVENT_UPDATING_PROJECTS_VISIBILITY_TO_PRIVATE_SETTING)) {
return true;