user API: allow to disable writes ...

... even if the user has permissions for these actions
This commit is contained in:
Nicola Murino
2021-07-23 21:41:02 +02:00
parent 85a47810ff
commit 83c7453957
7 changed files with 97 additions and 13 deletions

View File

@@ -632,13 +632,13 @@ func (s *httpdServer) initializeRouter() {
router.With(checkHTTPUserPerm(sdk.WebClientPubKeyChangeDisabled)).Get(userPublicKeysPath, getUserPublicKeys)
router.With(checkHTTPUserPerm(sdk.WebClientPubKeyChangeDisabled)).Put(userPublicKeysPath, setUserPublicKeys)
router.Get(userFolderPath, readUserFolder)
router.Post(userFolderPath, createUserDir)
router.Patch(userFolderPath, renameUserDir)
router.Delete(userFolderPath, deleteUserDir)
router.With(checkHTTPUserPerm(sdk.WebClientWriteDisabled)).Post(userFolderPath, createUserDir)
router.With(checkHTTPUserPerm(sdk.WebClientWriteDisabled)).Patch(userFolderPath, renameUserDir)
router.With(checkHTTPUserPerm(sdk.WebClientWriteDisabled)).Delete(userFolderPath, deleteUserDir)
router.Get(userFilePath, getUserFile)
router.Post(userFilePath, uploadUserFiles)
router.Patch(userFilePath, renameUserFile)
router.Delete(userFilePath, deleteUserFile)
router.With(checkHTTPUserPerm(sdk.WebClientWriteDisabled)).Post(userFilePath, uploadUserFiles)
router.With(checkHTTPUserPerm(sdk.WebClientWriteDisabled)).Patch(userFilePath, renameUserFile)
router.With(checkHTTPUserPerm(sdk.WebClientWriteDisabled)).Delete(userFilePath, deleteUserFile)
router.Post(userStreamZipPath, getUserFilesAsZipStream)
})