user8929084
user8929084

Reputation: 21

MS Graph AllowToAddGuests is available for owner of a Group?

We have created a WP that we have published to Teams that would give owners the possibility to modify the external sharing setting ("AllowToAddGuests") from a tab in their Teams. We are experiencing a problem when we try to do the set of AllowToAddGuests using an owner account. The Teams app has :

 {
        "resource": "Microsoft Graph",
        "scope": "Directory.ReadWrite.All"
      }

As per MS Graph docs

https://learn.microsoft.com/en-us/graph/api/directorysetting-update?view=graph-rest-beta&tabs=http

should work fine with delegated. If I execute the graph call in the graph explorer using the owner user it gives the same access error. All permissions are granted at admin level. If a global admin is used, then all works fine. The error I am receiving is the following:

{
    "error": {
        "code": "Authorization_RequestDenied",
        "message": "Insufficient privileges to complete the operation.",
        "innerError": {
            "date": "2020-07-02T15:18:56",
            "request-id": "84fe9be9-a4b0-4023-93e6-68dd780ce2ea"
        }
    }
}

Has the owner the possibility to change the flag AllowToAddGuests or should I do this via an App reg? Thanks for the answers. Alex

Upvotes: 1

Views: 444

Answers (1)

user8929084
user8929084

Reputation: 21

I am posting this here so that if anybody looks for the same information, they have it here. At the time of this writing, the answer we got from Microsoft is that for this call to work, the user performing the call (in our case one of the owners) needs to also be a Group Administrator. For our use case this was not doable as any user in the company can potentially be an owner of a MS Teams. The solution we have chosen is to use application permission with Directory.ReadWrite.All to perform the call. This works as expected now. Microsoft has also promised they will update the documentation in order to include the current information.

Upvotes: 1

Related Questions