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

Method UserRights

pkg/auth/rights/fetcher.go:223–239  ·  view source on GitHub ↗
(ctx context.Context, userID *ttnpb.UserIdentifiers)

Source from the content-addressed store, hash-verified

221}
222
223func (f accessFetcher) UserRights(ctx context.Context, userID *ttnpb.UserIdentifiers) (*ttnpb.Rights, error) {
224 cc := f.getConn(ctx)
225 if cc == nil {
226 return nil, errNoISConn.New()
227 }
228 callOpt, err := rpcmetadata.WithForwardedAuth(ctx, f.allowInsecure)
229 if err != nil {
230 return nil, err
231 }
232 ctx = rpcmetadata.WithForwardedRequestID(ctx)
233 rights, err := ttnpb.NewUserAccessClient(cc).ListRights(ctx, userID, callOpt)
234 registerRightsFetch(ctx, "user", rights, err)
235 if err != nil {
236 return nil, err
237 }
238 return rights, nil
239}

Callers

nothing calls this directly

Calls 6

WithForwardedAuthFunction · 0.92
WithForwardedRequestIDFunction · 0.92
NewUserAccessClientFunction · 0.92
registerRightsFetchFunction · 0.85
NewMethod · 0.65
ListRightsMethod · 0.65

Tested by

no test coverage detected