if ( dn.isEmpty() )
{
String msg = I18n.err( I18n.ERR_12 );
LOG.error( msg );
throw new LdapNoPermissionException( msg );
}
if ( dn.equals( ADMIN_GROUP_DN ) )
{
String msg = I18n.err( I18n.ERR_13 );
LOG.error( msg );
throw new LdapNoPermissionException( msg );
}
Dn principalDn = getPrincipal().getDn();
if ( dn.equals( ADMIN_SYSTEM_DN ) )
{
String msg = I18n.err( I18n.ERR_14, principalDn.getName() );
LOG.error( msg );
throw new LdapNoPermissionException( msg );
}
if ( dn.size() > 2 && !isAnAdministrator(principalDn) )
{
if ( dn.isDescendantOf( ADMIN_SYSTEM_DN ) )
{
String msg = I18n.err( I18n.ERR_15, principalDn.getName(), dn.getName() );
LOG.error( msg );
throw new LdapNoPermissionException( msg );
}
if ( dn.isDescendantOf( GROUP_BASE_DN ) )
{
String msg = I18n.err( I18n.ERR_16, principalDn.getName(), dn.getName() );
LOG.error( msg );
throw new LdapNoPermissionException( msg );
}
}
nextInterceptor.delete( deleteContext );
}