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

Add support for object permissions of TreeItem #264

Closed
wants to merge 1 commit into from

Conversation

go-run-jump
Copy link

In order to try this out please follow these steps:

  • ./manage.py migrate
  • Add two users in the shell and make them staff (to be able to use the admin login).
  • Restrict access to permissions for one TreeItem and set the Permissions granting access (i.e. to "can view site tree item").
  • The admins of django-guardian and django-sitetree clash. So for now assigning the permission has to be done in the shell: Use assign_perm (https://django-guardian.readthedocs.io/en/stable/userguide/assign.html) to give one of the new users the permission ('view_treeitem').
  • Now you shouldn't see this item when logged out or as the other new user. The user who was assigned the permission should be able to view it.

Do you know how the naming of those permissions works? Is the app label always a part in the django.auth base permission system? You were writing, that we could make it configurable in the settings. Is there a usecase for being able to change this?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 94.913% when pulling 01787bb on lorenz-bienek:master into 61de460 on idlesign:master.

@idlesign
Copy link
Owner

Thank you. I'll try to check it out in a couple of days.

Is the app label always a part in the django.auth base permission system?

Yes. See ModelBackend._get_permissions

Is there a usecase for being able to change this?

Guardian is ;)

@idlesign
Copy link
Owner

idlesign commented May 7, 2019

Closed due to a feature from #265

@idlesign idlesign closed this May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants