code: def check_permissions(self, request):
          
          permissions = [permission() for permission in self.permission_classes]
          for permission in permissions:
              if not permission.has_permission(request):
                  raise PermissionDenied()
docs: Check if the request should be permitted.
          Raises an appropriate exception if the request is not permitted.