aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2013-02-22 16:04:52 +0000
committerOlivier Lamy <olamy@apache.org>2013-02-22 16:04:52 +0000
commit7c7f3233bb1b9d7b2d25aee2f557205b4fcd0ed3 (patch)
treef5917ac48bb3db2ca29a78f2fa6eec1dbf5f201c /archiva-modules
parentb7df9ae27ef66e30f88334934640d025062ac265 (diff)
downloadarchiva-7c7f3233bb1b9d7b2d25aee2f557205b4fcd0ed3.tar.gz
archiva-7c7f3233bb1b9d7b2d25aee2f557205b4fcd0ed3.zip
make sure rbacmanager is not readonly before chaining write actions
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1449090 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-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 )
{