- Notifications
You must be signed in to change notification settings - Fork 1k
Description
Category
- Bug
Describe the bug
I am currently using "this.context.pageContext.legacyPageContext.guestsEnabled" property to identify if the site collection is shared externally or not.
However, when i look at this link https://docs.microsoft.com/en-us/javascript/api/sp-page-context/pagecontext?view=sp-typescript-latest#legacypagecontext. It says that this property is legacy and are encouraged to use the SharePoint Framework TypeScript APIs instead.
I am not able to find a relevant SharePoint Framework TypeScript API to identify the external sharing on site collections so i am submitting in GItHub as per the below Note.
"NOTE: If certain functionality is exposed in the legacyPageContext but does not seem to have a proper TypeScript API, please file an issue on GitHub. The intention is that no modern application should need to rely on the legacyPageContext object."
If there is a relevant SharePoint Framework TypeScript API to achieve this, please share.
Also, i would like to highlight another point that, this property "this.context.pageContext.legacyPageContext.guestsEnabled " returns FALSE when we choose Existing Guests only Option in Admin for external sharing (Attached the below screenshot). However, if i choose the New and Existing Guests option it returns "True", I was expecting "True" for both the selections.

Which property we need to use which returns True for the above selection.
Thanks in advance!