SharePoint Embedded assign permissions to container to an Azure AD group #9805
Labels
Needs: Author Feedback
Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days.
Needs: Triage 🔍
Awaiting categorization and initial review.
sharepoint-developer-support
sharepoint-developer-support
type:bug-suspected
Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
other (enter in the "Additional environment details" area below)
Developer environment
Windows
What browser(s) / client(s) have you tested
Additional environment details
Describe the bug / error
Using the graphServiceClient I am attempting to add permissions to a SharePoint embedded container to an Azure AD group. The examples and the documentation on the Graph API don't have examples and nothing says it isn't possible to assign a group to the sharepoint embedded container. Below is the executing code:
`var requestBody = new Permission
{
Roles = new List
{
"writer"
},
GrantedToV2 = new SharePointIdentitySet
{
Group = new Identity
{
Id = "17d4e352-2cff-41e8-902a-96ad2f33f3d0"
},
}
};
try
{
}
catch(Exception ex)
{
var exception = ex;
}`
The exception I am seeing is: 'userPrincipalName' is required.
at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.d__28.MoveNext()
at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.d__20
1.MoveNext() at Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.<SendAsync>d__20
1.MoveNext()at Microsoft.Graph.Storage.FileStorage.Containers.Item.Permissions.PermissionsRequestBuilder.d__7.MoveNext()
Steps to reproduce
{
Roles = new List
{
"writer"
},
GrantedToV2 = new SharePointIdentitySet
{
Group = new Identity
{
Id = "17d4e352-2cff-41e8-902a-96ad2f33f3d0"
},
}
};
try
{
}
catch(Exception ex)
{
var exception = ex;
}`
3. See exception
Expected behavior
I would expect to be able to assign permissions to an Azure AD group to a Sharepoint embedded container. This is to allow all the members of the group permissions to the files in that container.
The text was updated successfully, but these errors were encountered: