support static nodes in standalone device policies

This commit is contained in:
abhishek9686 2025-02-03 16:02:42 +04:00
parent 9a40717b5b
commit 46d79ee512

View file

@ -280,12 +280,15 @@ func IsAclPolicyValid(acl models.Acl) bool {
return false
}
} else {
_, err := GetNodeByID(dstI.Value)
if err != nil {
_, nodeErr := GetNodeByID(dstI.Value)
if nodeErr != nil {
_, staticNodeErr := GetExtClient(dstI.Value, acl.NetworkID.String())
if staticNodeErr != nil {
return false
}
}
}
}
case models.DevicePolicy:
for _, srcI := range acl.Src {
if srcI.ID == "" || srcI.Value == "" {
@ -329,13 +332,16 @@ func IsAclPolicyValid(acl models.Acl) bool {
return false
}
} else {
_, err := GetNodeByID(dstI.Value)
if err != nil {
_, nodeErr := GetNodeByID(dstI.Value)
if nodeErr != nil {
_, staticNodeErr := GetExtClient(dstI.Value, acl.NetworkID.String())
if staticNodeErr != nil {
return false
}
}
}
}
}
return true
}