mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-06 05:04:27 +08:00
fix all resources tag on egress
This commit is contained in:
parent
f82b9e861d
commit
b1672267d2
1 changed files with 9 additions and 6 deletions
|
@ -46,12 +46,15 @@ func DoesNodeHaveAccessToEgress(node *models.Node, e *schema.Egress, acls []mode
|
|||
}
|
||||
srcVal := ConvAclTagToValueMap(acl.Src)
|
||||
for _, dstI := range acl.Dst {
|
||||
if dstI.ID == models.EgressID && dstI.Value == e.ID {
|
||||
e := schema.Egress{ID: dstI.Value}
|
||||
err := e.Get(db.WithContext(context.TODO()))
|
||||
if err != nil {
|
||||
continue
|
||||
if (dstI.ID == models.EgressID && dstI.Value == e.ID) || (dstI.ID == models.NodeTagID && dstI.Value == "*") {
|
||||
if dstI.ID == models.EgressID {
|
||||
e := schema.Egress{ID: dstI.Value}
|
||||
err := e.Get(db.WithContext(context.TODO()))
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
if node.IsStatic {
|
||||
if _, ok := srcVal[node.StaticNode.ClientID]; ok {
|
||||
return true
|
||||
|
@ -67,8 +70,8 @@ func DoesNodeHaveAccessToEgress(node *models.Node, e *schema.Egress, acls []mode
|
|||
return true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return false
|
||||
|
|
Loading…
Add table
Reference in a new issue