diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2017-04-27 14:56:39 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2017-04-28 18:36:09 +0200 |
commit | 8d3eac2ec8afe884fdae95dffa96bcda23048d42 (patch) | |
tree | e28bf2351de9abe0b3286033682858dd6267292a /it/it-plugins | |
parent | fdfa49be4133e34b6bb5849a137166eb29bf9109 (diff) | |
download | sonarqube-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.java | 8 |
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; |