       api_function = add_role_to_user_api
            if method == &#34;delete&#34;:
                api_function = remove_user_role_api

        if api_function is not None:
            return await api_key_protector(
                self.api_implementation,
                tenant_id,
                api_options,
                api_function,
                user_context,
            )

        return None

    async def handle_error(
        self,
        request: BaseRequest,
        err: SuperTokensErr