fix: allow user admins to manage groups (#4498)

This commit is contained in:
Jon Ayers
2022-10-12 14:33:03 -05:00
committed by GitHub
parent 2a1bfb3e44
commit 47805643f7
3 changed files with 11 additions and 1 deletions
+1
View File
@@ -127,6 +127,7 @@ var (
ResourceUser.Type: {ActionCreate, ActionRead, ActionUpdate, ActionDelete},
// Full perms to manage org members
ResourceOrganizationMember.Type: {ActionCreate, ActionRead, ActionUpdate, ActionDelete},
ResourceGroup.Type: {ActionCreate, ActionRead, ActionUpdate, ActionDelete},
}),
}
},
+9
View File
@@ -369,6 +369,15 @@ func TestRolePermissions(t *testing.T) {
false: {memberMe, otherOrgAdmin, otherOrgMember, userAdmin},
},
},
{
Name: "Groups",
Actions: []rbac.Action{rbac.ActionRead},
Resource: rbac.ResourceGroup.InOrg(orgID),
AuthorizeMap: map[bool][]authSubject{
true: {owner, orgAdmin, userAdmin, orgMemberMe},
false: {memberMe, otherOrgAdmin, otherOrgMember, templateAdmin},
},
},
}
for _, c := range testCases {