Are there any gotchas for Admin integration? I'm able to get the .has_perm checks to pass correctly using the examples in the docs, but the admin site passes 403 forbidden when trying to use them. I've set up GuardedModelAdmin in my admin.py page as per the docs. Example code: (I'm assuming this type of looping through every user and object is how you set rules; the docs only show doing it with single objects)
for user in User.objects.all():
for person in Person.objects.all():
# Only allow view/change/edit/add for people in the same section as the user.
if person.section == user.person.section:
UserObjectPersmission.objects.assign('change_person', user, obj=person)
UserObjectPersmission.objects.assign('add_person', user, obj=person)
UserObjectPersmission.objects.assign('delete_person', user, obj=person)
# These checks work as intended, but the admin page doesn't provide links to view/edit Person objects,
and manually going to the url results in 403: Forbidden.
section_a_user.has_perm('myapp.add_person', section_a_person) # True
section_a_user.has_perm('myapp.add_person', section_b_person) # False
I need to integrate in the admin panel the multiple choices for groups and members.
If i add manually the groups and member it works fine
Thanks for support
@Allan-Nava , your problem is a separate problem from the initial problem in this issue.
Sorry, but how can i handle and administrate this functionality?
Thanks for support
2017-11-28 16:13 GMT+01:00 Adam Dobrawy notifications@github.com:
@Allan-Nava https://github.com/allan-nava , your problem is a separate
problem from the initial problem in this issue.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/django-guardian/django-guardian/issues/506#issuecomment-347554200,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AVdMg8NrGik7wcSewjluFyZtu3qPVyE5ks5s7CL-gaJpZM4NcH1s
.
@Allan-Nava , create a seperate issue instead of cluttering other issues that are not related to your problem.
Sorry @ad-m,
I have create an issue #536 .
I don't understand why it needs to specify the object(group) when the breadcrumb specify the group. I attach the example
Hi, do we have any update on the actual issue? I'm not getting it to work too.