summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web/archiva-web-common
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/archiva-web/archiva-web-common
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/archiva-web/archiva-web-common')
-rw-r--r--archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaRbacManager.java43
1 files changed, 30 insertions, 13 deletions
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 )
{