Skip to content

Commit dc65257

Browse files
committed
Remove need to be in the org for the group to work in the rego
1 parent 7297c3c commit dc65257

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

coderd/rbac/partial.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ EachQueryLoop:
8080
// inspect this any further. But just in case, we will verify each expression
8181
// did resolve to 'true'. This is purely defensive programming.
8282
for _, exp := range results[0].Expressions {
83-
if exp.String() != "true" {
83+
if v, ok := exp.Value.(bool); !ok || !v {
8484
continue EachQueryLoop
8585
}
8686
}
@@ -117,6 +117,7 @@ func newPartialAuthorizer(ctx context.Context, subjectID string, roles []Role, s
117117
"input.object.owner",
118118
"input.object.org_owner",
119119
"input.object.acl_user_list",
120+
"input.object.acl_group_list",
120121
}),
121122
rego.Input(input),
122123
).Partial(ctx)

coderd/rbac/policy.rego

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,9 @@ acl_allow {
208208
# Currently the simplfied queries return extra queries that are always
209209
# false. If these 2 lines are combined, we reduce the number of queries
210210
# returned by partial execution.
211-
input.object.org_owner != ""
211+
# input.object.org_owner != ""
212212
# Only people in the org can use the team access.
213-
org_mem
213+
# org_mem
214214
group := input.subject.groups[_]
215215
perms := input.object.acl_group_list[group]
216216
# Either the input action or wildcard

0 commit comments

Comments
 (0)