suggest: give BeginRequest a return value
#Documentation for the iris project can be found at https://github.com/kataras/iris#-learn. iris version: 8.5.0 go version: 1.9.1 beta
In my case have multi-role users, I need to check user role in BeginRequest, I want to return response if role check fail
so give BeginRequest a return value can let me know this operation result.
I think verify user permissions should at middleware, not at BeginRequest handler
for multi-role, a different role can visit different controller, so I need to check it in BeginRequest handler
@tfzxyinhao You can do that with the current implementation. BeginRequest can also terminate the request skipping the method function: https://github.com/kataras/iris/blob/master/mvc/activator/activator.go#L142
You have to write ctx.StopExecution() inside your BeginRequest, easy enough, no need to change the public API for that thing, BeginRequest should be fast.