mirror of
https://github.com/safing/portbase
synced 2025-09-04 19:50:18 +00:00
Review related changes
This commit is contained in:
parent
1b55c73559
commit
0464f5be48
2 changed files with 10 additions and 6 deletions
|
@ -70,7 +70,7 @@ func (mng *Manager) Start() error {
|
||||||
configKeyPrefixes[sub.ConfigKeySpace] = sub
|
configKeyPrefixes[sub.ConfigKeySpace] = sub
|
||||||
}
|
}
|
||||||
|
|
||||||
// aggmngate all modules dependencies (and the subsystem module itself)
|
// aggregate all modules dependencies (and the subsystem module itself)
|
||||||
// into the Modules slice. Configuration options form dependened modules
|
// into the Modules slice. Configuration options form dependened modules
|
||||||
// will be marked using config.SubsystemAnnotation if not already set.
|
// will be marked using config.SubsystemAnnotation if not already set.
|
||||||
for _, sub := range mng.subsys {
|
for _, sub := range mng.subsys {
|
||||||
|
|
|
@ -216,14 +216,18 @@ func (r *Registry) Query(q *query.Query, local, internal bool) (*iterator.Iterat
|
||||||
for _, r := range records {
|
for _, r := range records {
|
||||||
r.Lock()
|
r.Lock()
|
||||||
var (
|
var (
|
||||||
matchesKey = q.MatchesKey(r.DatabaseKey())
|
matchesKey = q.MatchesKey(r.DatabaseKey())
|
||||||
isValid = r.Meta().CheckValidity()
|
isValid = r.Meta().CheckValidity()
|
||||||
isAllowed = r.Meta().CheckPermission(local, internal)
|
isAllowed = r.Meta().CheckPermission(local, internal)
|
||||||
matchesRecord = q.MatchesRecord(r)
|
|
||||||
|
allowed = matchesKey && isValid && isAllowed
|
||||||
)
|
)
|
||||||
|
if allowed {
|
||||||
|
allowed = q.MatchesRecord(r)
|
||||||
|
}
|
||||||
r.Unlock()
|
r.Unlock()
|
||||||
|
|
||||||
if !(matchesKey && isValid && isAllowed && matchesRecord) {
|
if !allowed {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue