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

Method SafeRoleNames

coderd/rbac/authz.go:170–175  ·  view source on GitHub ↗

SafeRoleNames prevent nil pointer dereference.

()

Source from the content-addressed store, hash-verified

168
169// SafeRoleNames prevent nil pointer dereference.
170func (s Subject) SafeRoleNames() []RoleIdentifier {
171 if s.Roles == nil {
172 return []RoleIdentifier{}
173 }
174 return s.Roles.Names()
175}
176
177// HasOrganizationMembership reports whether the subject has explicit
178// membership in organizationID through an org-scoped role. Site-wide roles

Callers 7

RateLimitFunction · 0.95
EqualMethod · 0.95
AuthorizeFilterFunction · 0.80
AuthorizeMethod · 0.80
AuthorizeContextMethod · 0.80
checkAuthorizationMethod · 0.80
rbacTraceAttributesFunction · 0.80

Calls 1

NamesMethod · 0.65

Tested by

no test coverage detected