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

Function OrganizationMemberParam

coderd/httpmw/organizationparam.go:36–42  ·  view source on GitHub ↗

OrganizationMemberParam returns the organization membership that allowed the query from the ExtractOrganizationParam handler.

(r *http.Request)

Source from the content-addressed store, hash-verified

34// OrganizationMemberParam returns the organization membership that allowed the query
35// from the ExtractOrganizationParam handler.
36func OrganizationMemberParam(r *http.Request) OrganizationMember {
37 organizationMember, ok := r.Context().Value(organizationMemberParamContextKey{}).(OrganizationMember)
38 if !ok {
39 panic("developer error: organization member param middleware not provided")
40 }
41 return organizationMember
42}
43
44func OrganizationMembersParam(r *http.Request) OrganizationMembers {
45 organizationMembers, ok := r.Context().Value(organizationMembersParamContextKey{}).(OrganizationMembers)

Callers 5

organizationMemberMethod · 0.92
putMemberRolesMethod · 0.92
TestOrganizationParamFunction · 0.92

Calls 2

ContextMethod · 0.65
ValueMethod · 0.45

Tested by 1

TestOrganizationParamFunction · 0.74