-
Notifications
You must be signed in to change notification settings - Fork 130
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
Checking of object-permissions for TreeItem #263
Comments
Let's think it over.
I wonder how that works, since |
You're absolutly right. It should be more like
|
We could prepend app label as an option (through settings), but before that I'd like to make sure it solves the problem. So I'd like to ask you to make a fork of this repo and add guardian into |
I've checked the demo, thank you. In #265 I introduce a new better support for customization. It should cover a wide variety of use cases including yours. Please give it a try, documentation is updated accordingly. |
What are your thoughts about this? |
It seems that we need a caching dict in |
I really like the functionality of this library and would like to use it in a projekt together with django-guardian for object-permissions. This enables me to give a specific user or group the permission to view a TreeItem.
At the moment the check for permissions in line 893 of sitetreeapp.py can't do that as it is not model-specific:
user_perms = set(context['user'].get_all_permissions())
If I add the line below (new syntax for brevity) it works as I want it to.
user_perms.add(f"{item._meta.app_label}.{context['user'].get_all_permissions(item)}")
Is there another way to achieve that properly?
Would you be willing to accept a pull-request with such an enhancement?
The text was updated successfully, but these errors were encountered: