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

Dynamic Permissions #1956

Closed
1 task done
KiltzX opened this issue Jan 23, 2024 · 1 comment
Closed
1 task done

Dynamic Permissions #1956

KiltzX opened this issue Jan 23, 2024 · 1 comment
Labels
kind/question Further information is requested

Comments

@KiltzX
Copy link

KiltzX commented Jan 23, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Feature description

I want to know if there is a way to add permissions dynamically, for example, I would like to configure my application so that the user with id 10 does not have permission to such a resource, and that this would be added within the policies, but then instead of only the user with id 10, but also the user with id 12, and at some point remove the user with id 10

What would the ideal solution look like to you?

No response

Anything else?

No response

@KiltzX KiltzX changed the title <title> Dynamic Permissions </title> Dynamic Permissions Jan 23, 2024
@charithe
Copy link
Contributor

It sounds like you're trying to implement an access control list (ACL). One way to do that is to store the mapping of resource to users in your own database. Databases are optimized for set membership checks over very large sets so you can do that preliminary check first and make the result an attribute of the principal (e.g. is_in_acl). It would then become one of the conditions in your Cerbos policy (P.attr.is_in_acl == true) and you can combine that with the other context-sensitive security rules you need in addition to the simple ACL membership check (e.g. is the request being made from a trusted IP range during office hours).

@charithe charithe added kind/question Further information is requested and removed kind/feature status/triage labels Jan 23, 2024
@charithe charithe closed this as not planned Won't fix, can't repro, duplicate, stale Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants