Querying Role Assignment Data #371
Answered
by
jansenbe
kentlhastings
asked this question in
Q&A
-
Hello all, I would like to query a particular folder and read its RoleAssignments in order to assign the same roles to some other folders and files, but this seems to require a call to QueryOptions as it's a nested property from the parent folder. What is the proper way to execute this query, if ListItemAllFields doesn't have a QueryOptions member? var source = await context.Web.GetFolderByServerRelativeUrlAsync(folderPath, x => x.ListItemAllFields.RoleAssignments); Thank you! |
Beta Was this translation helpful? Give feedback.
Answered by
jansenbe
Mar 26, 2021
Replies: 1 comment 8 replies
-
You can use the QueryProperties LINQ method to realize this: var source = await context.Web.GetFolderByServerRelativeUrlAsync(folder.ServerRelativeUrl, x => x.ItemCount, x => x.Folders, x => x.Files, x => x.ListItemAllFields.QueryProperties(p => p.RoleAssignments)); |
Beta Was this translation helpful? Give feedback.
8 replies
Answer selected by
kentlhastings
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use the QueryProperties LINQ method to realize this: