AllowAdmin allows only authorized clients with "admin" access role. Should be registered after Verify.
(ctx iris.Context)
| 54 | // AllowAdmin allows only authorized clients with "admin" access role. |
| 55 | // Should be registered after Verify. |
| 56 | func AllowAdmin(ctx iris.Context) { |
| 57 | if !IsAdmin(ctx) { |
| 58 | ctx.StopWithText(iris.StatusForbidden, "admin access required") |
| 59 | return |
| 60 | } |
| 61 | |
| 62 | ctx.Next() |
| 63 | } |
| 64 | |
| 65 | // SignIn accepts the user form data and returns a token to authorize a client. |
| 66 | func SignIn(repo repository.UserRepository) iris.Handler { |
nothing calls this directly
no test coverage detected
searching dependent graphs…