Initial work on access rules middleware.