package main import ( "github.com/kataras/iris" ) func main() { app := iris.New() v1 := app.Party("/api/v1") myFilter := func(ctx iris.Context) bool { // don't do that on production, use session or/and database calls and etc. ok, _ := ctx.URLParamBool("admin") return ok } onlyWhenFilter1 := func(ctx iris.Context) { ctx.Application().Logger().Infof("admin: %s", ctx.Params()) ctx.Next() } onlyWhenFilter2 := func(ctx iris.Context) { // You can always use the per-request storage // to perform actions like this ofc. // // this handler: ctx.Values().Set("is_admin", true) // next handler: isAdmin := ctx.Values().GetBoolDefault("is_admin", false) // // but, let's simplify it: ctx.HTML("