Added creation options so we can create team site with the graph api for application and delegated permissions #1220
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature for using the graph api to create a team site with group for both delegeted and app permissions.
What I did was I'm currently using the delegeted way to create a team site with group with language but I got a feature request from my organisation to also support ResourceBehaviorOptions.
But we can't set ResourceBehaviorOptions when using the delegated way. So I was looking at the api calls from sharepoint and found that they post the following data with creating a team site with group:
Then I was curious what the meaning of the "CreationOptions" was.
Were I found out that it was also stored in the group when I get group with the graph api:
And if you look at the call response it contains the
CreationOptions
.So then I did a request with the graph explorer to test this with delegated permissions if I can create a group with
CreationOptions
And it succeedded. And when I checked the sharepoint site language it was Czech.
Why I chose Czech. This is because it is a language I do not know and I would recognize the changed sharepoint url.
So I saw that the shared documents url now Sdilene%20dokumenty was.
Then I changed the code in the pnp.core.admin project to check if it works with App permissions and it did.
So that is the reason why I removed the sharepoint api call part and changed it all to the Graph api.