(user *model.User, meta *model.Meta, path string)
| 70 | } |
| 71 | |
| 72 | func 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 | } |