GetActor returns the actor from the context. It usually represents the user who is interacting with the system.
(ctx context.Context)
| 37 | |
| 38 | // GetActor returns the actor from the context. It usually represents the user who is interacting with the system. |
| 39 | func GetActor(ctx context.Context) (*accesscontrol.Actor, error) { |
| 40 | v, ok := Get[*accesscontrol.Actor](ctx, actorKey) |
| 41 | if !ok { |
| 42 | return nil, shared.ErrInvalidActor() |
| 43 | } |
| 44 | return v, nil |
| 45 | } |
| 46 | |
| 47 | func SetProjectID(ctx context.Context, projectId string) context.Context { |
| 48 | return Set(ctx, projectIdKey, projectId) |
no test coverage detected