diff options
author | Michal Duda <michal.duda@sonarsource.com> | 2021-02-15 15:22:39 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-02-19 20:07:20 +0000 |
commit | f449396f5195716c39d74c12c3bafbdfcb1c254e (patch) | |
tree | 47cfcb975c6cf64d03db8a6aa40d40449ecda683 /sonar-core/src/main | |
parent | 051e3928d422fe40aa24184ff88d142f6c5d2016 (diff) | |
download | sonarqube-f449396f5195716c39d74c12c3bafbdfcb1c254e.tar.gz sonarqube-f449396f5195716c39d74c12c3bafbdfcb1c254e.zip |
SONAR-14458 Add an option to enable/disable changing user permissions by project administrator
Diffstat (limited to 'sonar-core/src/main')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/config/SecurityProperties.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/config/SecurityProperties.java b/sonar-core/src/main/java/org/sonar/core/config/SecurityProperties.java index 3103df9524f..e9e20c59335 100644 --- a/sonar-core/src/main/java/org/sonar/core/config/SecurityProperties.java +++ b/sonar-core/src/main/java/org/sonar/core/config/SecurityProperties.java @@ -24,7 +24,7 @@ import org.sonar.api.CoreProperties; import org.sonar.api.PropertyType; import org.sonar.api.config.PropertyDefinition; -import static java.util.Collections.singletonList; +import static java.util.Arrays.asList; class SecurityProperties { @@ -33,7 +33,7 @@ class SecurityProperties { } static List<PropertyDefinition> all() { - return singletonList( + return asList( PropertyDefinition.builder(CoreProperties.CORE_FORCE_AUTHENTICATION_PROPERTY) .defaultValue(Boolean.toString(CoreProperties.CORE_FORCE_AUTHENTICATION_DEFAULT_VALUE)) .name("Force user authentication") @@ -43,7 +43,17 @@ class SecurityProperties { + "<br><strong>Disabling this setting can expose the instance to security risks.</strong>") .type(PropertyType.BOOLEAN) .category(CoreProperties.CATEGORY_SECURITY) - .build()); + .build(), + PropertyDefinition.builder(CoreProperties.CORE_ALLOW_PERMISSION_MANAGEMENT_FOR_PROJECT_ADMINS_PROPERTY) + .defaultValue(Boolean.toString(CoreProperties.CORE_ALLOW_PERMISSION_MANAGEMENT_FOR_PROJECT_ADMINS_DEFAULT_VALUE)) + .name("Enable permission management for project administrators") + .description( + "Set if users with 'Administer' role in a project should be allowed to change project permissions. By default users with 'Administer' " + + "role are allowed to change both project configuration and project permissions.") + .type(PropertyType.BOOLEAN) + .category(CoreProperties.CATEGORY_SECURITY) + .build() + ); } } |