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:
parent
e8c9121897
commit
0392abb261
|
@ -364,16 +364,24 @@ public class LdapRbacManager
|
||||||
{
|
{
|
||||||
for ( String roleName : roleNames )
|
for ( String roleName : roleNames )
|
||||||
{
|
{
|
||||||
Role role = this.rbacImpl.getRole( roleName );
|
Role role = buildRole( roleName );
|
||||||
role = ( role == null ) ? new RoleImpl( roleName ) : role;
|
|
||||||
if ( role != null )
|
|
||||||
{
|
|
||||||
rolesCache.put( role.getName(), role );
|
|
||||||
roles.add( role );
|
roles.add( role );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if ( this.ldapRoleMapper.isUseDefaultRoleName() )
|
else if ( this.ldapRoleMapper.isUseDefaultRoleName() )
|
||||||
|
{
|
||||||
|
Role role = buildRole( group );
|
||||||
|
roles.add( role );
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return roles;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private Role buildRole( String group )
|
||||||
|
throws RbacManagerException
|
||||||
{
|
{
|
||||||
Role role = null;
|
Role role = null;
|
||||||
try
|
try
|
||||||
|
@ -388,13 +396,9 @@ public class LdapRbacManager
|
||||||
if ( role != null )
|
if ( role != null )
|
||||||
{
|
{
|
||||||
rolesCache.put( role.getName(), role );
|
rolesCache.put( role.getName(), role );
|
||||||
roles.add( role );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
return role;
|
||||||
return roles;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List<String> getRealRoles()
|
protected List<String> getRealRoles()
|
||||||
|
|
Loading…
Reference in New Issue