UserID returns the userID from the context
(ctx context.Context)
| 302 | |
| 303 | // UserID returns the userID from the context |
| 304 | func UserID(ctx context.Context) string { |
| 305 | userID := ctx.Value(UserIDFlag) |
| 306 | if userID == nil { |
| 307 | return "" |
| 308 | } |
| 309 | return userID.(string) |
| 310 | } |
| 311 | |
| 312 | // GetAdminContext will return an admin context. This can be used internally |
| 313 | // when fetching users. |
no outgoing calls