feat: obj list api
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
package fs
|
||||
|
||||
import (
|
||||
"github.com/alist-org/alist/v3/pkg/utils"
|
||||
"io"
|
||||
"mime"
|
||||
"net/http"
|
||||
@ -64,19 +63,3 @@ func getFileStreamFromLink(file model.Obj, link *model.Link) (model.FileStreamer
|
||||
}
|
||||
return stream, nil
|
||||
}
|
||||
|
||||
func canAccess(user *model.User, meta *model.Meta, path string) bool {
|
||||
// if is not guest, can access
|
||||
if user.IsAdmin() || user.IgnorePassword {
|
||||
return true
|
||||
}
|
||||
// if meta is nil or password is empty, can access
|
||||
if meta == nil || meta.Password == "" {
|
||||
return true
|
||||
}
|
||||
// if meta doesn't apply to sub_folder, can access
|
||||
if !utils.PathEqual(meta.Path, path) && !meta.SubFolder {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
Reference in New Issue
Block a user