From b711ad5ff68b6893f1d5854d71fffaeb889677db Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 18 Jan 2013 18:24:19 +0000 Subject: [PATCH] override to check faster existence of a role git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1435285 13f79535-47bb-0310-9956-ffa450edef68 --- .../web/security/ArchivaRbacManager.java | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) 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 ec2780baf..ff6b11bf6 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 @@ -44,7 +44,7 @@ import java.util.Map; * @author Olivier Lamy * @since 1.4-M4 */ -@Service( "rbacManager#archiva" ) +@Service("rbacManager#archiva") public class ArchivaRbacManager extends AbstractRBACManager implements RBACManager @@ -290,6 +290,29 @@ public class ArchivaRbacManager getRbacManagerForCommon().removeUserAssignment( userAssignment ); } + @Override + public boolean roleExists( String name ) + throws RbacManagerException + { + boolean exists = false; + for ( RBACManager manager : rbacManagersPerId.values() ) + { + exists = manager.roleExists( name ); + if ( exists ) + { + return true; + } + } + return exists; + } + + @Override + public boolean roleExists( Role role ) + throws RbacManagerException + { + return roleExists( role.getName() ); + } + public void eraseDatabase() { log.warn( "eraseDatabase not implemented" );