if ( dn.toString().equals( "" ) ) { String msg = "The rootDSE cannot be modified!"; throw new LdapNoPermissionException( msg ); }
    private void protectModifyAlterations( Name dn ) throws LdapNoPermissionException    {        Invocation invocation = getInvocation();        if ( invocation.getState() == InvocationStateEnum.PREINVOCATION )        {            Name principalDn = getPrincipal( invocation ).getDn();            if ( ! principalDn.equals( ADMIN_DN ) )            {                if ( dn == ADMIN_DN || dn.equals( ADMIN_DN ) )                {                    String msg = "User " + principalDn;                    msg += " does not have permission to modify the admin account.";                    throw new LdapNoPermissionException( msg );                }                if ( dn.size() > 2 && dn.startsWith( USER_BASE_DN ) )                {                    String msg = "User " + principalDn;                    msg += " does not have permission to modify the account of the";                    msg += " user " + dn + ".\nEven the owner of an account cannot";                    msg += " modify it.\nUser accounts can only be modified by the";                    msg += " administrator.";                    throw new LdapNoPermissionException( msg );                }                if ( dn.size() > 2 && dn.startsWith( GROUP_BASE_DN ) )                {                    String msg = "User " + principalDn;                    msg += " does not have permission to modify the group entry ";                    msg += dn + ".\nGroups can only be modified by the admin.";                    throw new LdapNoPermissionException( msg );                }            }        }    }