if ( dn.isEmpty() )
{
String msg = I18n.err( I18n.ERR_234 );
LOG.error( msg );
throw new LdapNoPermissionException( msg );
}
if ( dn.getNormName().equals( ADMIN_GROUP_DN.getNormName() ) )
{
String msg = I18n.err( I18n.ERR_21 );
LOG.error( msg );
throw new LdapNoPermissionException( msg );
}
if ( isTheAdministrator( dn ) )
{
String msg = I18n.err( I18n.ERR_22, principalDn.getName(), dn.getName() );
LOG.error( msg );
throw new LdapNoPermissionException( msg );
}
if ( dn.size() > 2 && dn.startsWith( USER_BASE_DN ) && !isAnAdministrator( principalDn ) )
{
String msg = I18n.err( I18n.ERR_23, principalDn.getName(), dn.getName() );
LOG.error( msg );
throw new LdapNoPermissionException( msg );
}
if ( dn.size() > 2 && dn.startsWith( GROUP_BASE_DN ) && !isAnAdministrator( principalDn ) )
{
String msg = I18n.err( I18n.ERR_24, principalDn.getName(), dn.getName() );
LOG.error( msg );
throw new LdapNoPermissionException( msg );
}
}