ory / ladon

A SDK for access control policies: authorization for the microservice and IoT age. Inspired by AWS IAM policies. Written for Go.

Home Page:https://www.ory.sh/?utm_source=github&utm_medium=banner&utm_campaign=ladon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exposing more methods for finding policies

ugodiggi opened this issue · comments

This is a followup to the conversation on https://community.ory.sh/t/exposing-more-methods-for-finding-policies/555/

It would be helpful for me to have more nuanced methods for finding policies, in particular I’d like to expose in the Manager interface an explicit method for FindPoliciesForResource.
I can provide a pull request for this for ladon, that is efficient for MySQL/Postgresql.

The reason for this not being implemented right now is that the library actually doesn't need that. I'm thinking if it would make sense to have it as a separate library that extends this manager so it's more like an add-in as opposed to a first-class citizen. What do you think?

I pushed a pull request for reference (#120) for what I have in mind.

The core question for me is how to fit this in the manager interface, so that I can use the memory manager for testing and the Postgres manager in production. Can you give me more details on what you imagine as a separate library?

Thank you for the fast review!