MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / whetherHide

Function whetherHide

internal/fs/list.go:72–91  ·  view source on GitHub ↗
(user *model.User, meta *model.Meta, path string)

Source from the content-addressed store, hash-verified

70}
71
72func whetherHide(user *model.User, meta *model.Meta, path string) bool {
73 // if is admin, don't hide
74 if user == nil || user.CanSeeHides() {
75 return false
76 }
77 // if meta is nil, don't hide
78 if meta == nil {
79 return false
80 }
81 // if meta.Hide is empty, don't hide
82 if meta.Hide == "" {
83 return false
84 }
85 // if meta doesn't apply to sub_folder, don't hide
86 if !common.MetaCoversPath(meta.Path, path, meta.HSub) {
87 return false
88 }
89 // if is guest, hide
90 return true
91}

Callers 2

TestWhetherHideFunction · 0.85
listFunction · 0.85

Calls 2

MetaCoversPathFunction · 0.92
CanSeeHidesMethod · 0.80

Tested by 1

TestWhetherHideFunction · 0.68