fix: check password while upload (close #2444)
This commit is contained in:
@ -35,7 +35,7 @@ func FsMkdir(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if !canWrite(meta, req.Path) {
|
||||
if !common.CanWrite(meta, req.Path) {
|
||||
common.ErrorResp(c, errs.PermissionDenied, 403)
|
||||
return
|
||||
}
|
||||
@ -48,13 +48,6 @@ func FsMkdir(c *gin.Context) {
|
||||
common.SuccessResp(c)
|
||||
}
|
||||
|
||||
func canWrite(meta *model.Meta, path string) bool {
|
||||
if meta == nil || !meta.Write {
|
||||
return false
|
||||
}
|
||||
return meta.WSub || meta.Path == path
|
||||
}
|
||||
|
||||
type MoveCopyReq struct {
|
||||
SrcDir string `json:"src_dir"`
|
||||
DstDir string `json:"dst_dir"`
|
||||
|
Reference in New Issue
Block a user