- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Question] Prioritizing based on role and user hierarchy level #831
Comments
@merajsahebdar can you give a concrete example for this?
|
@closetool @tangyang9464 |
@merajsahebdar In your example, just change the priority can solve it. Do you have any other specific examples? |
@merajsahebdar |
@hsluoyz @tangyang9464 @closetool As I've described in my question, this is the structure we have:
However, I know we can easily pass the priority in policy definitions like this:
But in cases that we have more than one level like this:
It could be hard to manage those priority numbers, cause in some cases we don't know how many levels do we have? and by editing and changing role levels we could face problems and need to change all definitions. What I'm looking for is a way to prioritize policy definitions automatically by their levels in their tree; so in my last example policies that belong to
|
@hsluoyz @closetool Can we use |
@merajsahebdar I didn't get it, could you demonstrate it with a well designed example, instead of words. |
@closetool Ok.
I expect line: 2, rewrites line: 1 automatically.
@tangyang9464 or maybe a method like: |
@merajsahebdar ok,I will try to make a pr |
@tangyang9464 Thanks, then let me know for any help! 🙏🏻 |
🎉 This issue has been resolved in version 2.33.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
@merajsahebdar The part of our docs about this feature refers to your statement.Let you know.See #254 |
What's your scenario? What do you want to achieve?
As I read in documents, by default Casbin designed to prioritize rules by given definition order (1); and also there is a way to add priority in rules definitions (2). But what I need in my app is to be able to prioritize by roles/users levels; and as levels could be infinite, I can't use the (2) approach, cause in every change I need to change all priority levels.
Is there a way to prioritze based on hierarchy level currently? If no, is it possible to implement a feature for this?
Your model:
Your policy:
Your request(s):
The text was updated successfully, but these errors were encountered: