Sean Condon | f69b047 | 2022-01-11 14:10:45 +0000 | [diff] [blame] | 1 | # SPDX-FileCopyrightText: 2022-present Open Networking Foundation <info@opennetworking.org> |
| 2 | # |
Sean Condon | 160ec1d | 2022-02-08 12:58:25 +0000 | [diff] [blame] | 3 | # SPDX-License-Identifier: Apache-2.0 |
Sean Condon | f69b047 | 2022-01-11 14:10:45 +0000 | [diff] [blame] | 4 | |
Sean Condon | 65dbad9 | 2022-02-04 13:36:47 +0000 | [diff] [blame] | 5 | package aether_2_0_x |
Sean Condon | f69b047 | 2022-01-11 14:10:45 +0000 | [diff] [blame] | 6 | |
| 7 | echo[config] { |
| 8 | config := input |
| 9 | } |
| 10 | |
| 11 | allowed[config] { |
Sean Condon | 0eeac17 | 2022-01-24 09:14:13 +0000 | [diff] [blame] | 12 | enterprise := enterprise_rule |
Sean Condon | f69b047 | 2022-01-11 14:10:45 +0000 | [diff] [blame] | 13 | config := { |
Sean Condon | 0eeac17 | 2022-01-24 09:14:13 +0000 | [diff] [blame] | 14 | "connectivity_services": object.get(input, "connectivity_services", {}), |
| 15 | "enterprises": { |
Sean Condon | f69b047 | 2022-01-11 14:10:45 +0000 | [diff] [blame] | 16 | "enterprise": [ |
| 17 | enterprise |
| 18 | ] |
Sean Condon | f69b047 | 2022-01-11 14:10:45 +0000 | [diff] [blame] | 19 | } |
| 20 | } |
| 21 | } |
| 22 | |
Sean Condon | 0eeac17 | 2022-01-24 09:14:13 +0000 | [diff] [blame] | 23 | enterprise_rule[enterprise] { |
| 24 | enterprise := input.enterprises.enterprise[_] |
Sean Condon | aed9237 | 2022-02-03 16:43:23 +0000 | [diff] [blame] | 25 | ["AetherROCAdmin", enterprise.enterprise_id][_] == input.groups[i] |
Sean Condon | f69b047 | 2022-01-11 14:10:45 +0000 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | can_update_enterprise = true { |
Sean Condon | 0eeac17 | 2022-01-24 09:14:13 +0000 | [diff] [blame] | 29 | update_enterprise := input.updates.enterprises.enterprise[_] |
Sean Condon | aed9237 | 2022-02-03 16:43:23 +0000 | [diff] [blame] | 30 | ["AetherROCAdmin", update_enterprise.enterprise_id][_] == input.groups[i] |
Sean Condon | f69b047 | 2022-01-11 14:10:45 +0000 | [diff] [blame] | 31 | } |