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

Function rightsToScope

pkg/oauth/oauth.go:48–55  ·  view source on GitHub ↗

rightsToScope transforms the list of rights into a string "scope". This function is only used for compatibility with osin.

(rights ...ttnpb.Right)

Source from the content-addressed store, hash-verified

46// rightsToScope transforms the list of rights into a string "scope".
47// This function is only used for compatibility with osin.
48func rightsToScope(rights ...ttnpb.Right) string {
49 rights = ttnpb.RightsFrom(rights...).Sorted().GetRights()
50 rightStrings := make([]string, len(rights))
51 for i, right := range rights {
52 rightStrings[i] = right.String()
53 }
54 return strings.Join(rightStrings, " ")
55}
56
57// rightsFromScope is the opposite of RightsToScope. It transforms the string "scope" back into a list of rights.
58// This function is only used for compatibility with osin.

Callers 3

AuthorizeMethod · 0.85
LoadAuthorizeMethod · 0.85
loadAccessMethod · 0.85

Calls 5

RightsFromFunction · 0.92
SortedMethod · 0.80
StringMethod · 0.65
JoinMethod · 0.65
GetRightsMethod · 0.45

Tested by

no test coverage detected