pnp / pnpframework

PnP Framework is a .NET library targeting Microsoft 365 containing the PnP Provisioning engine and a ton of other useful extensions

Home Page:https://pnp.github.io/pnpframework/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Web extension DisableRequestAccess not working

luismanez opened this issue · comments

I want to disable "Allow Access requests" in Site sharing settings. I mean this in the UI:
image

There is a Web extension that should do the job (and worked in the past) but is not working now. This is the current code:

        public static void DisableRequestAccess(this Web web)
        {
            web.RequestAccessEmail = string.Empty;
            web.Update();
            web.Context.ExecuteQueryRetry();
        }

As per my tests now is not enough with setting an Empty email and an extra step is required.

I'm about to do a PR to fix it, but openning an issue first for traceability.