Trying to restore personal file to file of share received folder returns 403 but the share file is deleted (`new` dav path)
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 274
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 103
Description
## Steps to reproduce
1. as admin, add a folder (`myfolder`) and a file inside it (`myfolder/lorem.txt`)
3. as admin, share the folder to user `demo`
4. as demo, create a same named file (`lorem.txt`) and delete it
5. as demo, try to restore the deleted file to the share received folder (`using new dav path`)
```bash
curl -XMOVE 'https://localhost:9200/remote.php/dav/trash-bin/demo/bc1b3655-4801-4646-90a1-d39b5be6bcc7' \
-H'Destination: https://localhost:9200/remote.php/dav/files/demo/Shares/myfolder/lorem.txt' -udemo:demo -vk
```
```xml
< HTTP/1.1 403 Forbidden
Sabre\DAV\Exception\Forbidden
Permission denied to restore
```
:exclamation: `lorem.txt` file in the share folder is deleted and moved to trashbin of sharer (admin) :exclamation:
With `spaces` endpoint: :heavy_check_mark:
```bash
curl -XMOVE 'https://localhost:9200/remote.php/dav/spaces/trash-bin/14cb34c2-9a97-40d4-9cb5-c0e221bbd9cb$bca43c23-9616-465f-a433-ae001b3092fa/bc1b3655-4801-4646-90a1-d39b5be6bcc7' \
-H'Destination: https://localhost:9200/remote.php/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668/myfolder/lorem.txt' -uadmin:admin -vk
```
```bash
< HTTP/1.1 400 Bad Request
```
`lorem.txt` exists - no change
### Related issues:
- https://github.com/owncloud/ocis/issues/1976
Contributor guide
Assessment
This issue has not been assessed yet.