summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java5
-rw-r--r--archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaRbacManager.java43
2 files changed, 33 insertions, 15 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java
index e582f628e..1a2481398 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/runtime/DefaultRedbackRuntimeConfigurationAdmin.java
@@ -145,8 +145,9 @@ public class DefaultRedbackRuntimeConfigurationAdmin
ldapConfiguration.setUseRoleNameAsGroup(
userConfiguration.getBoolean( UserConfigurationKeys.LDAP_GROUPS_USE_ROLENAME, false ) );
- ldapConfiguration.setBindAuthenticatorEnabled(
- userConfiguration.getBoolean( UserConfigurationKeys.LDAP_BIND_AUTHENTICATOR_ENABLED, false ) );
+ boolean ldapBindAuthenticatorEnabled =
+ userConfiguration.getBoolean( UserConfigurationKeys.LDAP_BIND_AUTHENTICATOR_ENABLED, false );
+ ldapConfiguration.setBindAuthenticatorEnabled( ldapBindAuthenticatorEnabled );
redbackRuntimeConfiguration.setMigratedFromRedbackConfiguration( true );
diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaRbacManager.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaRbacManager.java
index fd24898bf..e5b144be9 100644
--- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaRbacManager.java
+++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaRbacManager.java
@@ -144,8 +144,11 @@ public class ArchivaRbacManager
{
try
{
- role = rbacManager.saveRole( role );
- allFailed = false;
+ if ( !rbacManager.isReadOnly() )
+ {
+ role = rbacManager.saveRole( role );
+ allFailed = false;
+ }
}
catch ( Exception e )
{
@@ -168,8 +171,11 @@ public class ArchivaRbacManager
{
try
{
- rbacManager.saveRoles( roles );
- allFailed = false;
+ if ( !rbacManager.isReadOnly() )
+ {
+ rbacManager.saveRoles( roles );
+ allFailed = false;
+ }
}
catch ( Exception e )
{
@@ -294,8 +300,11 @@ public class ArchivaRbacManager
{
try
{
- permission = rbacManager.savePermission( permission );
- allFailed = false;
+ if ( rbacManager.isReadOnly() )
+ {
+ permission = rbacManager.savePermission( permission );
+ allFailed = false;
+ }
}
catch ( Exception e )
{
@@ -416,8 +425,11 @@ public class ArchivaRbacManager
{
try
{
- operation = rbacManager.saveOperation( operation );
- allFailed = false;
+ if ( !rbacManager.isReadOnly() )
+ {
+ operation = rbacManager.saveOperation( operation );
+ allFailed = false;
+ }
}
catch ( Exception e )
{
@@ -537,9 +549,11 @@ public class ArchivaRbacManager
{
try
{
- resource = rbacManager.saveResource( resource );
-
- allFailed = false;
+ if ( !rbacManager.isReadOnly() )
+ {
+ resource = rbacManager.saveResource( resource );
+ allFailed = false;
+ }
}
catch ( Exception e )
{
@@ -659,8 +673,11 @@ public class ArchivaRbacManager
{
try
{
- userAssignment = rbacManager.saveUserAssignment( userAssignment );
- allFailed = false;
+ if ( !rbacManager.isReadOnly() )
+ {
+ userAssignment = rbacManager.saveUserAssignment( userAssignment );
+ allFailed = false;
+ }
}
catch ( Exception e )
{