MCPcopy Index your code
hub / github.com/coder/coder / UnmarshalJSON

Method UnmarshalJSON

coderd/rbac/roles.go:116–130  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

114}
115
116func (r *RoleIdentifier) UnmarshalJSON(data []byte) error {
117 var str string
118 err := json.Unmarshal(data, &str)
119 if err != nil {
120 return err
121 }
122
123 v, err := RoleNameFromString(str)
124 if err != nil {
125 return err
126 }
127
128 *r = v
129 return nil
130}
131
132// The functions below ONLY need to exist for roles that are "defaulted" in some way.
133// Any other roles (like auditor), can be listed and let the user select/assigned.

Callers

nothing calls this directly

Calls 2

RoleNameFromStringFunction · 0.85
UnmarshalMethod · 0.45

Tested by

no test coverage detected