Custom authorisation in Kong

We wanted to move our company’s custom authorisation to Kong. Currently we have an internal table which maps URLs to scopes and using the request URL and consumer details we are able to authorise the request. We want to move all this to Kong.

We need to maintain a table on Kong level which has the different scopes associated with the different URLs. Calling another service to get the scope is also one solution for this. Any suggestions or recommended methods for this?