def permission_denied(self, request, message=None):
        """
        If request is not permitted, determine what kind of exception to raise.
        """
        if not request.successful_authenticator:
            raise exceptions.NotAuthenticated()
        raise exceptions.PermissionDenied(detail=message)
def permission_denied ( self , request , message = None ) : if not request . successful_authenticator : raise exceptions . NotAuthenticated ( ) raise exceptions . PermissionDenied ( detail = message )
If request is not permitted, determine what kind of exception to raise.