remove duplicate code

git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1437806 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2013-01-23 23:51:59 +00:00
parent e8c9121897
commit 0392abb261
1 changed files with 26 additions and 22 deletions

View File

@ -364,16 +364,24 @@ public class LdapRbacManager
{
for ( String roleName : roleNames )
{
Role role = this.rbacImpl.getRole( roleName );
role = ( role == null ) ? new RoleImpl( roleName ) : role;
if ( role != null )
{
rolesCache.put( role.getName(), role );
Role role = buildRole( roleName );
roles.add( role );
}
}
}
else if ( this.ldapRoleMapper.isUseDefaultRoleName() )
{
Role role = buildRole( group );
roles.add( role );
}
}
return roles;
}
private Role buildRole( String group )
throws RbacManagerException
{
Role role = null;
try
@ -388,13 +396,9 @@ public class LdapRbacManager
if ( role != null )
{
rolesCache.put( role.getName(), role );
roles.add( role );
}
}
}
return roles;
return role;
}
protected List<String> getRealRoles()