Common implementation of 'access()' and 'role()' callbacks
(ctx context.Context, user otto.Value, value otto.Value, mapping map[string][]string)
| 223 | |
| 224 | // Common implementation of 'access()' and 'role()' callbacks |
| 225 | func (runner *SyncRunner) addValueForUser(ctx context.Context, user otto.Value, value otto.Value, mapping map[string][]string) otto.Value { |
| 226 | valueStrings := ottoValueToStringArray(ctx, value) |
| 227 | if len(valueStrings) > 0 { |
| 228 | for _, name := range ottoValueToStringArray(ctx, user) { |
| 229 | mapping[name] = append(mapping[name], valueStrings...) |
| 230 | } |
| 231 | } |
| 232 | return otto.UndefinedValue() |
| 233 | } |
| 234 | |
| 235 | func compileAccessMap(input map[string][]string, prefix string) (AccessMap, error) { |
| 236 | access := make(AccessMap, len(input)) |
no test coverage detected