Fix permissions check when moving a file to a different directory over webdav

Fixes #9095 

cc @PVince81 @DeepDiver1975