(ctx context.Context)
| 102 | } |
| 103 | |
| 104 | func requireCurrentOrg(ctx context.Context) (*entities.Org, error) { |
| 105 | currentOrg := entities.CurrentOrg(ctx) |
| 106 | if currentOrg == nil { |
| 107 | return nil, errors.NotFound("not found", "current organization not set") |
| 108 | } |
| 109 | |
| 110 | return currentOrg, nil |
| 111 | } |
| 112 | |
| 113 | func requireCurrentAuthzSubject(ctx context.Context) (string, error) { |
| 114 | sub := usercontext.CurrentAuthzSubject(ctx) |