Skip to content

Commit 931da98

Browse files
authored
Merge pull request #4964 from aduffeck/debug-wopi-500
Handle permission denied errors when touching the new file
2 parents 4f31fd9 + 336e871 commit 931da98

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Bugfix: Fix a wrong error code when approvider creates a new file
2+
3+
We fixed a problem where the approvider would return a 500 error instead of 403 when trying to create a new file in a read-only share.
4+
5+
https://github.com/cs3org/reva/pull/4964

internal/http/services/appprovider/appprovider.go

+4
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ func (s *svc) handleNew(w http.ResponseWriter, r *http.Request) {
237237
}
238238

239239
if touchRes.Status.Code != rpc.Code_CODE_OK {
240+
if touchRes.Status.Code == rpc.Code_CODE_PERMISSION_DENIED {
241+
writeError(w, r, appErrorPermissionDenied, "permission denied to create the file", nil)
242+
return
243+
}
240244
writeError(w, r, appErrorServerError, "touching the file failed", nil)
241245
return
242246
}

0 commit comments

Comments
 (0)