mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-24 12:46:15 +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)
|
srcVal := ConvAclTagToValueMap(acl.Src)
|
||||||
for _, dstI := range acl.Dst {
|
for _, dstI := range acl.Dst {
|
||||||
if dstI.ID == models.EgressID && dstI.Value == e.ID {
|
if (dstI.ID == models.EgressID && dstI.Value == e.ID) || (dstI.ID == models.NodeTagID && dstI.Value == "*") {
|
||||||
e := schema.Egress{ID: dstI.Value}
|
if dstI.ID == models.EgressID {
|
||||||
err := e.Get(db.WithContext(context.TODO()))
|
e := schema.Egress{ID: dstI.Value}
|
||||||
if err != nil {
|
err := e.Get(db.WithContext(context.TODO()))
|
||||||
continue
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if node.IsStatic {
|
if node.IsStatic {
|
||||||
if _, ok := srcVal[node.StaticNode.ClientID]; ok {
|
if _, ok := srcVal[node.StaticNode.ClientID]; ok {
|
||||||
return true
|
return true
|
||||||
|
|
@ -67,8 +70,8 @@ func DoesNodeHaveAccessToEgress(node *models.Node, e *schema.Egress, acls []mode
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue