Skip to content

Commit

Permalink
fix: apply all fs user rulles
Browse files Browse the repository at this point in the history
  • Loading branch information
o1egl committed Jun 22, 2020
1 parent 5023e77 commit 68f8348
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions http/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@ type data struct {

// Check implements rules.Checker.
func (d *data) Check(path string) bool {
for _, rule := range d.user.Rules {
allow := true
for _, rule := range d.settings.Rules {
if rule.Matches(path) {
return rule.Allow
allow = rule.Allow
}
}

for _, rule := range d.settings.Rules {
for _, rule := range d.user.Rules {
if rule.Matches(path) {
return rule.Allow
allow = rule.Allow
}
}

return true
return allow
}

func handle(fn handleFunc, prefix string, store *storage.Storage, server *settings.Server) http.Handler {
Expand Down

0 comments on commit 68f8348

Please sign in to comment.