@@ -31,12 +31,12 @@ import rego.v1
31
31
32
32
# bool_flip lets you assign a value to an inverted bool.
33
33
# You cannot do 'x := !false', but you can do 'x := bool_flip(false)'
34
- bool_flip (b) = flipped if {
34
+ bool_flip (b) : = flipped if {
35
35
b
36
36
flipped = false
37
37
}
38
38
39
- bool_flip (b) = flipped if {
39
+ bool_flip (b) : = flipped if {
40
40
not b
41
41
flipped = true
42
42
}
@@ -45,17 +45,17 @@ bool_flip(b) = flipped if {
45
45
# -1: {false, true} or {false}
46
46
# 0: {}
47
47
# 1: {true}
48
- number (set) = c if {
48
+ number (set) : = c if {
49
49
count (set) == 0
50
50
c := 0
51
51
}
52
52
53
- number (set) = c if {
53
+ number (set) : = c if {
54
54
false in set
55
55
c := - 1
56
56
}
57
57
58
- number (set) = c if {
58
+ number (set) : = c if {
59
59
not false in set
60
60
set[_]
61
61
c := 1
@@ -64,7 +64,7 @@ number(set) = c if {
64
64
# site, org, and user rules are all similar. Each rule should return a number
65
65
# from [-1, 1]. The number corresponds to "negative", "abstain", and "positive"
66
66
# for the given level. See the 'allow' rules for how these numbers are used.
67
- default site = 0
67
+ default site : = 0
68
68
69
69
site := site_allow (input.subject.roles)
70
70
@@ -93,7 +93,7 @@ org_members := {orgID |
93
93
94
94
# org is the same as 'site' except we need to iterate over each organization
95
95
# that the actor is a member of.
96
- default org = 0
96
+ default org : = 0
97
97
98
98
org := org_allow (input.subject.roles)
99
99
@@ -193,7 +193,7 @@ org_ok if {
193
193
194
194
# User is the same as the site, except it only applies if the user owns the object and
195
195
# the user is apart of the org (if the object has an org).
196
- default user = 0
196
+ default user : = 0
197
197
198
198
user := user_allow (input.subject.roles)
199
199
0 commit comments