Django Rest Framework permissions not being called
<p>I'm currently converting all my views to generics, as I like how cleaner the code gets. I am trying to make my User detail view, like so:</p>

<pre><code># User.views

from Common import view_mixins, view_filters, view_permissions

class UserDetail(view_mixins.IntOrStrLookupMixin, generics.RetrieveUpdateDestroyAPIView):
   queryset = Profile.objects.all()

   lookup_fields = ('user__pk', 'user__username')
   lookup_url_kwarg = 'userid'

   filter_backends = (view_filters.ResourceVisibilityFilter, )
   permission_classes = (view_permissions.IsOwnerOrReadOnly, )

   serializer_class = ProfileSerializer

   def update(self, request, *args, **kwargs):
       user = self.get_object()
       return Response('whatever')
</code></pre>

<hr>

<pre><code># Common.view_permissions

SAFE_METHODS = ('GET', 'HEAD', 'OPTIONS')

class IsOwnerOrReadOnly(permissions.BasePermission):
    '''
    Owner of object can GET, PUT, DELETE. Everyone else can GET.
    '''

    def has_permission(self, request, view):
        return True

    def has_object_permission(self, request, view, obj):
        print('did you call me?')
        return (
            request.method in SAFE_METHODS
            or
            obj.user == request.user
        )
</code></pre>

<hr>

<pre><code># Common.view_mixins

class IntOrStrLookupMixin(object):
    """
    Apply to views that can be looked up by slug or pk
    """
    def get_object(self):
        queryset = self.get_queryset()
        queryset = self.filter_queryset(queryset)

        filter = {}

        for field in self.kwargs:
            argument = self.kwargs[field]

            if is_int(argument):
                filter[self.lookup_fields[0]] = argument
            else:
                filter[self.lookup_fields[1]] = argument

        return get_object_or_404(queryset, **filter)
</code></pre>

<p>So my issue is, the permission is never called. I can get the user just fine, but anyone can do PUT or DELETE on which I am trying to prevent.</p>