Hi,
I have a SPGroup. I want to find the permission of the group using C#? How to achieve this?
I am trying to assign the Group permission to a list item.
I have used the below code, but not sure, if it is correct:
private void AddRoles(SPWeb sPWeb, SPPrincipal spGroup, SPListItem item) { if (spGroup != null) { SPRoleAssignment oRoleAssignment = sPWeb.RoleAssignments.GetAssignmentByPrincipal(spGroup); item.RoleAssignments.Add(spGroup); } }If the custom group has Read permission, I want to assign the read permission to the listitem. How to achieve this?
Thanks