See: http://playframework.org/
The repo is created here: https://github.com/jcasbin/play-authz , you can make PR to add code to it.
You can see existing similar authorization modules for Play as reference: https://www.playframework.com/documentation/2.8.x/ModuleDirectory#Authentication-(Login-&-Registration)-and-Authorization-(Restricted-Access)

You can refer to how we make middleware for other web frameworks like:
See: http://playframework.org/
The repo is created here: https://github.com/jcasbin/play-authz , you can make PR to add code to it.
You can see existing similar authorization modules for Play as reference: https://www.playframework.com/documentation/2.8.x/ModuleDirectory#Authentication-(Login-&-Registration)-and-Authorization-(Restricted-Access)
You can refer to how we make middleware for other web frameworks like: