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
This commit is contained in:
Olivier Lamy 2013-01-18 18:24:19 +00:00
parent 09afc62ecb
commit b711ad5ff6
1 changed files with 24 additions and 1 deletions

View File

@ -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" );