Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DELETE issue #44

Closed
garrysrevenge opened this issue Nov 8, 2018 · 5 comments
Closed

DELETE issue #44

garrysrevenge opened this issue Nov 8, 2018 · 5 comments

Comments

@garrysrevenge
Copy link

garrysrevenge commented Nov 8, 2018

Hello!

Maybe this is a default behaviour, but when i delete a file but i haven't the permissions for this operation, i'll get an exeption on the server, but the client gets no dialog that this operation can't be done.

Is this right?

@ramondeklein
Copy link
Owner

The current implementation of the disk-store doesn't check if the service has the permission to remove the file. If the file cannot be deleted (either due to permission or another condition), you'll get an internal server error. You could change the DiskStoreCollection.DeleteItemAsync method and catch the specific exception that is thrown when you don't have permissions. In that case, you could return DavStatusCode.Forbidden instead.

@garrysrevenge
Copy link
Author

thx for the fast answer!

i tried your suggestion with no luck.
In your DisktoreCollection i added
_return Task.FromResult(DavStatusCode.Forbidden);
in the first line of DeleteItemSync. I never get an forbidden dialog.

Could you confirm that?

@garrysrevenge
Copy link
Author

@ramondeklein
Copy link
Owner

The WebDAV redirector has been improved in Windows 10, but I am not sure if it does interpret result-code Forbidden correctly in the current version. But it would be a good idea to have the server return the proper result-code for other clients.

ramondeklein added a commit that referenced this issue Dec 2, 2018
@ramondeklein
Copy link
Owner

I have updated the NWebDAV source, so it returns HTTP status Forbidden if the user hasn't permission to delete/move the file. Unfortunately, the Windows WebDAV client doesn't do anything with it. But it seems a bit cleaner than returning InternalServerError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants