NewMap returns a pointer to a new Map.
(rights map[string]*ttnpb.Rights)
| 29 | |
| 30 | // NewMap returns a pointer to a new Map. |
| 31 | func NewMap(rights map[string]*ttnpb.Rights) *Map { |
| 32 | m := &Map{} |
| 33 | for k, v := range rights { |
| 34 | m.SetRights(k, v) |
| 35 | } |
| 36 | return m |
| 37 | } |
| 38 | |
| 39 | // SetRights sets the rights for the given UID. |
| 40 | func (m *Map) SetRights(uid string, rights *ttnpb.Rights) { |