(user auth.User, scopeName string, collectionName string)
| 3355 | } |
| 3356 | |
| 3357 | func MakeUserCtx(user auth.User, scopeName string, collectionName string) (map[string]any, error) { |
| 3358 | if user == nil { |
| 3359 | return nil, nil |
| 3360 | } |
| 3361 | channels, err := user.InheritedCollectionChannels(scopeName, collectionName) |
| 3362 | if err != nil { |
| 3363 | return nil, err |
| 3364 | } |
| 3365 | return map[string]interface{}{ |
| 3366 | "name": user.Name(), |
| 3367 | "roles": user.RoleNames(), |
| 3368 | "channels": channels.AllKeys(), |
| 3369 | }, nil |
| 3370 | } |
| 3371 | |
| 3372 | // Are the principal and role names in an AccessMap all valid? |
| 3373 | func validateAccessMap(ctx context.Context, access channels.AccessMap) bool { |
no test coverage detected