blob: f17cbcf5698040b3e618a46c0bf774a0654528bc [file] [log] [blame]
Sean Condonb44c6ce2021-10-01 15:29:32 +01001# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
2#
Sean Condon160ec1d2022-02-08 12:58:25 +00003# SPDX-License-Identifier: Apache-2.0
Sean Condonb44c6ce2021-10-01 15:29:32 +01004
Sean Condon65dbad92022-02-04 13:36:47 +00005package aether_4_0_18
Sean Condonb44c6ce2021-10-01 15:29:32 +01006
7echo[config] {
8 config := input
9}
10
11allowed[config] {
12 application := applications # refer to rule below
13 connectivity_service := connectivityservices
14 device_group := devicegroups
15 enterprise := enterprises
16 ip_domain := ip_domains
Sean Condonb44c6ce2021-10-01 15:29:32 +010017 site := sites
18 template := templates
19 traffic_class := trafficclasses
20 upf := upfs
21 vcs := vcss
22 config := {
23 "application": {
24 "application": [
25 application
26 ]
27 },
28 "connectivity-service": {
29 "connectivity-service": [
30 connectivity_service
31 ]
32 },
33 "device-group": {
34 "device-group": [
35 device_group
36 ]
37 },
38 "enterprise": {
39 "enterprise": [
40 enterprise
41 ]
42 },
43 "ip-domain": {
44 "ip-domain": [
45 ip_domain
46 ]
47 },
Sean Condonb44c6ce2021-10-01 15:29:32 +010048 "site": {
49 "site": [
50 site
51 ]
52 },
53 "template": {
54 "template": [
55 template
56 ]
57 },
Sean Condon25c7bf52021-11-06 11:53:59 +000058 "traffic-class": {
59 "traffic-class": {
Sean Condonb44c6ce2021-10-01 15:29:32 +010060 traffic_class
61 }
62 },
63 "upf": {
64 "upf": [
65 upf
66 ]
67 },
68 "vcs": {
69 "vcs": [
70 vcs
71 ]
72 }
73 }
74}
75
76applications[application] {
77 application := input.application.application[_]
78 ["AetherROCAdmin", application.enterprise][_] == input.groups[i]
79}
80
81connectivityservices[connectivity_service] {
82 connectivity_service := input.connectivity_service.connectivity_service[_]
83}
84
85devicegroups[device_group] {
86 device_group := input.device_group.device_group[_]
87 site := sites
88 device_group.site == site[_].id # allow only the device_groups of a known site
89}
90
91enterprises[enterprise] {
92 enterprise := input.enterprise.enterprise[_]
93 ["AetherROCAdmin", enterprise.id][_] == input.groups[i]
94}
95
96ip_domains[ip_domain] {
97 ip_domain := input.ip_domain.ip_domain[_]
98 ["AetherROCAdmin", ip_domain.enterprise][_] == input.groups[i]
99}
100
Sean Condonb44c6ce2021-10-01 15:29:32 +0100101sites[site] {
102 site := input.site.site[_]
103 ["AetherROCAdmin", site.enterprise][_] == input.groups[i]
104}
105
106templates[template] {
107 template := input.template.template[_]
108}
109
110trafficclasses[traffic_class] {
111 traffic_class := input.traffic_class.traffic_class[_]
112}
113
114upfs[upf] {
115 upf := input.upf.upf[_]
116 ["AetherROCAdmin", upf.enterprise][_] == input.groups[i]
117}
118
119vcss[vcs] {
120 vcs := input.vcs.vcs[_]
121 ["AetherROCAdmin", vcs.enterprise][_] == input.groups[i]
122}
123
124can_update_enterprise = true {
125 update_enterprise := input.updates.enterprise.enterprise[_]
126 ["AetherROCAdmin", update_enterprise.id][_] == input.groups[i]
127}