Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule based on foreign key relationship #26

Closed
jwerardi opened this issue Nov 7, 2019 · 2 comments
Closed

Rule based on foreign key relationship #26

jwerardi opened this issue Nov 7, 2019 · 2 comments
Labels

Comments

@jwerardi
Copy link

jwerardi commented Nov 7, 2019

hi,

I have a series of relationships set up like this:

User
id
customer_id

Customer
id
distributor_id

Distributor
id

I have an endpoint like /user/, and I want to restrict users to only be able to see other users whose user.customer.distributor_id is the same as their user.customer.distributor_id

How would I go about setting up a rule for a scenario like this? Is it even possible to abstract these kinds of relationships into an ABAC schema?

@kolotaev
Copy link
Owner

kolotaev commented Nov 7, 2019

Hi,

Possibly related to #20.

@kolotaev
Copy link
Owner

kolotaev commented Dec 6, 2019

Currently it can be solved only by explicitly setting customer_distributor_id values and using InquiryMatch family of Rules.

There is also a a feature-request for adding the support of nested attributes, which might be helpful in this scenario.

@kolotaev kolotaev closed this as completed Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants