Actually I figured out I was assigning the permissions wrong in the view. 
But I really just need a "view" permission along with the default 
add/update/delete permissions. Is there a good way to add this to each app 
by default? Thanks



On Thursday, December 14, 2017 at 6:02:51 PM UTC-7, Alexander Joseph wrote:
>
> I'm trying to use the PermissionRequiredMixin but I'm a little confused on 
> how to use it. I keep getting an infinite redirect loop when the user tries 
> to visit the page if they dont have the required permissions.
>
> Here is my view
>
> from django.contrib.auth.mixins import LoginRequiredMixin, 
> PermissionRequiredMixin, AccessMixin
>
> class ProductListView(LoginRequiredMixin, PermissionRequiredMixin, 
> ListView):
>     permission_required = 'engineering_can_view'
>     context_object_name = "products"
>     model = Product
>     template_name = 'engineering/products/product_list.html'
>
> the 'engineering_can_view' is a group I made in django-admin.. not sure if 
> this is the right way to add permissions for a group. I wanted to apply the 
> permissions required to my own groups and add specific permissions to those 
> groups to view/edit/delete in the admin.'
>
> I am able to load the page as a superuser though.
>
> Thanks for any help you can give
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4fbcb0c6-3f0d-417b-a0f2-b89105dc4227%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to