chore: user permissions

This commit is contained in:
Noah Hsu
2022-06-29 18:03:12 +08:00
parent 3c7a2f78cf
commit d24e51bc86
11 changed files with 110 additions and 48 deletions

View File

@ -71,7 +71,7 @@ func FsList(c *gin.Context) {
func canAccess(user *model.User, meta *model.Meta, path string, password string) bool {
// if is not guest, can access
if user.IsAdmin() || user.IgnorePassword {
if user.CanAccessWithoutPassword() {
return true
}
// if meta is nil or password is empty, can access