MCPcopy Index your code
hub / github.com/coder/coder / TestingGetSystemRole

Function TestingGetSystemRole

coderd/rbac/rolestore/rolestore.go:173–190  ·  view source on GitHub ↗
(name string, orgID uuid.UUID, settings rbac.OrgSettings)

Source from the content-addressed store, hash-verified

171}
172
173func TestingGetSystemRole(name string, orgID uuid.UUID, settings rbac.OrgSettings) (rbac.Role, error) {
174 f, ok := systemRoles[name]
175 if !ok {
176 return rbac.Role{}, xerrors.Errorf("role %q not found", name)
177 }
178 perms := f(settings)
179 return rbac.Role{
180 Identifier: rbac.RoleIdentifier{Name: name, OrganizationID: orgID},
181 DisplayName: "",
182 Site: nil,
183 ByOrgID: map[string]rbac.OrgPermissions{
184 orgID.String(): {
185 Org: perms.Org,
186 Member: perms.Member,
187 },
188 },
189 }, nil
190}
191
192// permissionsFunc produces the desired permissions for a system role
193// given organization settings.

Callers 1

MemberSubjectFunction · 0.92

Calls 2

ErrorfMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected