## Description
When no delete rights, "quarto-permission-test" empty confluence pages dumped to root confluence space. 

## Steps to Reproduce
- Configure a Confluence space where the logged in publisher has no delete rights (only archive for example)
- Publish a quarto document to this space

### Expected Result
Document is published, no test documents are left behind.

If the account doesn't have permissions to delete the test page we will:
- Attempt to archive this test and fail gracefully if this too isn't supported
- Using the [Deno WebStorageAPI](https://deno.com/manual@v1.30.3/runtime/web_storage_api) save a flag that will disable this test in the future for this installation.  Set in `localStorage` to persist across sessions - essentially disable check after the first fail.

### Actual Result
- It prompts you to re-authorize the account
- After doing so, a test document is created but not deleted in the root of the space
- It re-authorizes you again in a loop
- The publish doesn't complete

### Workaround
- Publish to personal space, then manually move to target space

----

- For the permissions test we could
  - Detect that the delete failed and if so, attempt an archive?  Not ideal as there would be a growing list of test archive documents.
  - Create a flag or environment variable to prevent the test (this puts the burden on the publisher which isn't ideal) 
  - Remove the test as we aren't sure if it will create problems (this removes the warning which isn't ideal)
  - Do nothing, just advise as to the less-than-ideal work-around (publish to your personal space then move).
 


### Discussed in https://github.com/quarto-dev/quarto-cli/discussions/5295

<div type='discussions-op-text'>

<sup>Originally posted by **angelotrivelli** April 24, 2023</sup>

I found that when I tried to make quarto publish to a particular confluence space, it put empty pages in the root of that space. All the pages were titled like...

      `quarto-permission-test-71dc05b5-664b-4ac5-a0de-673c51bdbc03`

Where the `71dc...` is obviously some GUID, different for every page. 

For whatever reason, I am not able to publish an actual page to that confluence space. Instead it just dumps one of those empty files into the root of the space. 

If I publish to my personal space, I found I can then manually move my page from the personal space into wherever I want it, but I can't do it directly from quarto publish.

Unfortunately, I am not super proficient in confluence, nor quarto. Are there any pointers for troubleshooting what's going here? It's kind of embarrassing that quarto dumped a empty page like that (with my name on it) into a highly visible Confluence space.






</div>
allenmanning
2023-04-25T08:05:42Z
allenmanning
bug publishing-confluence
v1.4
closed
When no delete rights, confusing prompt, can't publish to confluence space - leaves test files behind.
https://github.com/quarto-dev/quarto-cli/issues/5299