Skip to content

Commit ea25c08

Browse files
committed
Allow wildcards for ACL list
1 parent f162694 commit ea25c08

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

coderd/rbac/authz_internal_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,13 @@ func TestAuthorizeDomain(t *testing.T) {
199199
actions: allActions(),
200200
allow: true,
201201
},
202+
{
203+
resource: ResourceWorkspace.WithOwner(unuseID.String()).InOrg(unuseID).WithACLUserList(map[string][]Action{
204+
user.UserID: {WildcardSymbol},
205+
}),
206+
actions: allActions(),
207+
allow: true,
208+
},
202209
{
203210
resource: ResourceWorkspace.WithOwner(unuseID.String()).InOrg(unuseID).WithACLUserList(map[string][]Action{
204211
user.UserID: {ActionRead, ActionUpdate},

coderd/rbac/policy.rego

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,8 @@ allow {
163163
perms := input.object.acl_user_list[input.subject.id]
164164
input.action in perms
165165
}
166+
167+
# ACL wildcard allow
168+
allow {
169+
"*" in input.object.acl_user_list[input.subject.id]
170+
}

0 commit comments

Comments
 (0)