|
@@ -46,16 +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.NodeTagID && dstI.Value == "*" {
|
|
|
- return true
|
|
|
- }
|
|
|
- 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
|
|
@@ -71,8 +70,8 @@ func DoesNodeHaveAccessToEgress(node *models.Node, e *schema.Egress, acls []mode
|
|
|
return true
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
return false
|