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( deleteContext ).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( GROUPS_BASE_DN ) )
{
String msg = I18n.err( I18n.ERR_16, principalDn.getName(), dn.getName() );
LOG.error( msg );
throw new LdapNoPermissionException( msg );
}
if ( dn.isDescendantOf( USERS_BASE_DN ) )
{
String msg = I18n.err( I18n.ERR_16, principalDn.getName(), dn.getName() );
LOG.error( msg );
throw new LdapNoPermissionException( msg );
}
}
next( deleteContext );
}