AsJSON is used to return this to the api without exposing the entitlements for mutation.
()
| 122 | // AsJSON is used to return this to the api without exposing the entitlements for |
| 123 | // mutation. |
| 124 | func (l *Set) AsJSON() json.RawMessage { |
| 125 | l.entitlementsMu.RLock() |
| 126 | defer l.entitlementsMu.RUnlock() |
| 127 | |
| 128 | b, _ := json.Marshal(l.entitlements) |
| 129 | return b |
| 130 | } |
| 131 | |
| 132 | func (l *Set) Modify(do func(entitlements *codersdk.Entitlements)) { |
| 133 | l.entitlementsMu.Lock() |
no test coverage detected