IsAdmin returns whether the caller is an admin.
(ctx context.Context)
| 427 | |
| 428 | // IsAdmin returns whether the caller is an admin. |
| 429 | func (is *IdentityServer) IsAdmin(ctx context.Context) bool { |
| 430 | authInfo, err := is.authInfo(ctx) |
| 431 | if err != nil { |
| 432 | return false |
| 433 | } |
| 434 | return authInfo.IsAdmin |
| 435 | } |
| 436 | |
| 437 | // RequireAdmin returns an error when the caller is not an admin. |
| 438 | func (is *IdentityServer) RequireAdmin(ctx context.Context) error { |
no test coverage detected