mirror of https://github.com/Xhofe/alist
parent
09f480318c
commit
ae791c8634
|
@ -17,7 +17,7 @@ func CanWrite(meta *model.Meta, path string) bool {
|
||||||
|
|
||||||
func CanAccess(user *model.User, meta *model.Meta, reqPath string, password string) bool {
|
func CanAccess(user *model.User, meta *model.Meta, reqPath string, password string) bool {
|
||||||
// if the reqPath is in hide (only can check the nearest meta) and user can't see hides, can't access
|
// if the reqPath is in hide (only can check the nearest meta) and user can't see hides, can't access
|
||||||
if meta != nil && !user.CanSeeHides() {
|
if meta != nil && !user.CanSeeHides() && meta.Hide != "" {
|
||||||
for _, hide := range strings.Split(meta.Hide, "\n") {
|
for _, hide := range strings.Split(meta.Hide, "\n") {
|
||||||
re := regexp.MustCompile(hide)
|
re := regexp.MustCompile(hide)
|
||||||
if re.MatchString(reqPath[len(meta.Path):]) {
|
if re.MatchString(reqPath[len(meta.Path):]) {
|
||||||
|
|
Loading…
Reference in New Issue