catch NameNotFoundException to return false as we check a group existence
git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1433977 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a02fa42251
commit
1222b2b217
@ -33,6 +33,7 @@
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import javax.naming.NameNotFoundException;
|
||||
import javax.naming.NamingEnumeration;
|
||||
import javax.naming.NamingException;
|
||||
import javax.naming.directory.Attribute;
|
||||
@ -205,6 +206,11 @@ public boolean hasRole( DirContext context, String roleName )
|
||||
|
||||
return namingEnumeration.hasMore();
|
||||
}
|
||||
catch ( NameNotFoundException e )
|
||||
{
|
||||
log.debug( "group {} for role {} not found", groupName, roleName );
|
||||
return false;
|
||||
}
|
||||
catch ( LdapException e )
|
||||
{
|
||||
throw new MappingException( e.getMessage(), e );
|
||||
|
Loading…
x
Reference in New Issue
Block a user