chore: unified function name

This commit is contained in:
Noah Hsu 2022-07-23 21:49:09 +08:00
parent 826e4807dc
commit 5166d73b4d
2 changed files with 2 additions and 2 deletions

View File

@ -85,6 +85,6 @@ func (u User) CanWebdavRead() bool {
return u.IsAdmin() || (u.Permission>>8)&1 == 1 return u.IsAdmin() || (u.Permission>>8)&1 == 1
} }
func (u User) CanWebdavWrite() bool { func (u User) CanWebdavManage() bool {
return u.IsAdmin() || (u.Permission>>9)&1 == 1 return u.IsAdmin() || (u.Permission>>9)&1 == 1
} }

View File

@ -79,7 +79,7 @@ func WebDAVAuth(c *gin.Context) {
c.Abort() c.Abort()
return return
} }
if !user.CanWebdavWrite() && utils.SliceContains([]string{"PUT", "DELETE", "PROPPATCH", "MKCOL", "COPY", "MOVE"}, c.Request.Method) { if !user.CanWebdavManage() && utils.SliceContains([]string{"PUT", "DELETE", "PROPPATCH", "MKCOL", "COPY", "MOVE"}, c.Request.Method) {
if c.Request.Method == "OPTIONS" { if c.Request.Method == "OPTIONS" {
c.Set("user", guest) c.Set("user", guest)
c.Next() c.Next()