blob: 80ea78ef78f92882a2299ab4e29230d245f54c27 [file] [log] [blame]
Sean Condonf69b0472022-01-11 14:10:45 +00001# SPDX-FileCopyrightText: 2022-present Open Networking Foundation <info@opennetworking.org>
2#
Sean Condon160ec1d2022-02-08 12:58:25 +00003# SPDX-License-Identifier: Apache-2.0
Sean Condonf69b0472022-01-11 14:10:45 +00004
Sean Condon65dbad92022-02-04 13:36:47 +00005package aether_2_0_x
Sean Condonf69b0472022-01-11 14:10:45 +00006
7echo[config] {
8 config := input
9}
10
11allowed[config] {
Sean Condon0eeac172022-01-24 09:14:13 +000012 enterprise := enterprise_rule
Sean Condonf69b0472022-01-11 14:10:45 +000013 config := {
Sean Condon0eeac172022-01-24 09:14:13 +000014 "connectivity_services": object.get(input, "connectivity_services", {}),
15 "enterprises": {
Sean Condonf69b0472022-01-11 14:10:45 +000016 "enterprise": [
17 enterprise
18 ]
Sean Condonf69b0472022-01-11 14:10:45 +000019 }
20 }
21}
22
Sean Condon0eeac172022-01-24 09:14:13 +000023enterprise_rule[enterprise] {
24 enterprise := input.enterprises.enterprise[_]
Sean Condonaed92372022-02-03 16:43:23 +000025 ["AetherROCAdmin", enterprise.enterprise_id][_] == input.groups[i]
Sean Condonf69b0472022-01-11 14:10:45 +000026}
27
28can_update_enterprise = true {
Sean Condon0eeac172022-01-24 09:14:13 +000029 update_enterprise := input.updates.enterprises.enterprise[_]
Sean Condonaed92372022-02-03 16:43:23 +000030 ["AetherROCAdmin", update_enterprise.enterprise_id][_] == input.groups[i]
Sean Condonf69b0472022-01-11 14:10:45 +000031}