MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / fromContext

Function fromContext

pkg/auth/rights/rights.go:150–155  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

148var rightsKey rightsKeyType
149
150func fromContext(ctx context.Context) (*Rights, bool) {
151 if rights, ok := ctx.Value(rightsKey).(*Rights); ok {
152 return rights, true
153 }
154 return &Rights{}, false
155}
156
157// NewContext returns a derived context with the given rights.
158func NewContext(ctx context.Context, rights *Rights) context.Context {

Callers 5

ListApplicationFunction · 0.85
ListClientFunction · 0.85
ListGatewayFunction · 0.85
ListOrganizationFunction · 0.85
ListUserFunction · 0.85

Calls 1

ValueMethod · 0.45

Tested by

no test coverage detected