Action based authorization middleware.