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

Function OrganizationRoles

coderd/rbac/roles.go:887–896  ·  view source on GitHub ↗

OrganizationRoles lists all roles that can be applied to an organization user in the given organization. This is the list of available roles, and specific to an organization. This should be a list in a database, but until then we build the list from the builtins.

(organizationID uuid.UUID)

Source from the content-addressed store, hash-verified

885// This should be a list in a database, but until then we build
886// the list from the builtins.
887func OrganizationRoles(organizationID uuid.UUID) []Role {
888 var roles []Role
889 for _, roleF := range builtInRoles {
890 role := roleF(organizationID)
891 if role.Identifier.OrganizationID == organizationID {
892 roles = append(roles, role)
893 }
894 }
895 return roles
896}
897
898// SiteBuiltInRoles lists all roles that can be applied to a user.
899// This is the list of available roles, and not specific to a user

Callers 3

assignableOrgRolesMethod · 0.92
TestBuiltInRolesFunction · 0.92
TestListRolesFunction · 0.92

Calls

no outgoing calls

Tested by 2

TestBuiltInRolesFunction · 0.74
TestListRolesFunction · 0.74