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

Method Intersect

pkg/ttnpb/rights.go:177–189  ·  view source on GitHub ↗

Intersect returns the rights that are contained in both r and b.

(b *Rights)

Source from the content-addressed store, hash-verified

175
176// Intersect returns the rights that are contained in both r and b.
177func (r *Rights) Intersect(b *Rights) *Rights {
178 if r == nil {
179 return &Rights{}
180 }
181 res := make([]Right, 0)
182 rs, bs := makeRightsSet(r), makeRightsSet(b)
183 for right := range rs {
184 if _, ok := bs[right]; ok {
185 res = append(res, right)
186 }
187 }
188 return &Rights{Rights: res}
189}
190
191// Implied returns the rights together with their implied rights.
192func (r *Rights) Implied() *Rights {

Callers 15

TestRightsFunction · 0.95
EventIsVisibleFunction · 0.80
GetRightsMethod · 0.80
allPotentialRightsFunction · 0.80
getRightsMethod · 0.80
listGatewayRightsMethod · 0.80
listApplicationRightsMethod · 0.80
listClientRightsMethod · 0.80
authInfoMethod · 0.80
restrictRightsFunction · 0.80

Calls 1

makeRightsSetFunction · 0.85