Replies: 1 comment 1 reply
-
@Ofer-Gal : see https://pnp.github.io/pnpcore/using-the-sdk/security-intro.html#assigning-roles. You would need to first break permission inheritance on your list (https://pnp.github.io/pnpcore/using-the-sdk/security-intro.html#breaking-permission-inheritance), set copyRoleAssignments to false so you start clean. Next you add the Read role to the Visitors group for that list (https://pnp.github.io/pnpcore/using-the-sdk/security-intro.html#assigning-roles-to-a-user-or-group). The documentation shows this for a user, but you can do the same with the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I know how to get the visitors group
ISharePointGroup sharePointGroup = await web.SiteGroups.FirstOrDefault(p => p.Title.Contains("Visitors")).GetAsync();
And a reference to a list.
IList DPCDocumentsList = await pnpContext.Web.Lists.GetByTitleAsync("DPC Documents");
Now I need to revoke "contribute" and grant "Read" to the Visitors on the "DPC Documents" library.
How do I do it?
Thank you Much
Beta Was this translation helpful? Give feedback.
All reactions