Search code examples
sharepoint-onlinecsomspfxsharepoint-jsom

How to check in sharepoint spfx component if underlying o365 group of current site is public or private?


Is it possible to check this using jsom in the spfx component itself somehow?

Otherwise I would need to call an external service, which would in turn call graph api, I am trying to avoid that. If that is the way to go however, what is the best way to get the group's id or name?

Thank you in advance.


Solution

  • @Taras,

    I found this property accidentally, i think it meets your requirement:

    enter image description here

    Request URL: https://abc.sharepoint.com/sites/testprivate/_api/web?$select=AllProperties&$expand=AllProperties
    

    enter image description here

    I also checked a public Office 365 group site, it fits perfectly.

    BR