title: How to return data with 403 error in Django Rest Framework?
body: <p>When a GET request goes to the API backend at <code>/obj/1</code></p>
  
  <p>I check a custom permissions class to see if user has access, if not, a 403 is sent back.</p>
  
  <p>However, I would like to attach the object ID so the user can click a button on the front-end to request access.</p>
  
  <p>My current implementation is to override the <code>retrieve</code> method and "manually" check permission there.</p>
  
  <p><strong>Simplified Permissions</strong></p>
  
  <pre><code>class CustomPerm(...):
      def has_object_permission(...):
          return request.user.is_staff
  </code></pre>
  
  <p><strong>Viewset</strong></p>
  
  <pre><code>class CustomViewSet(...):
      model = Model
      permission_classes = (CustomPerm, )
  
      def retrieve(self, request, pk=None):
          obj = get_object_or_404(Model, pk=pk)
  
          has_perm = CustomPerm().has_object_permission(request, self, obj=obj)
          if not has_perm:
              data = { 'id': obj.id }
              return Response(data, status=403)
  
          return super(ModelViewSet, self).retrieve(request, pk=pk)
  </code></pre>
  
  <p>So my current method, <code>has_perm</code> returns a QuerySet of users instead of a boolean as defined in the permissions method. How come?</p>
  
  <p>Is there a cleaner approach to this?</p>