I'm developing a solution that requires that I add new permission levels and edit existing ones using CSOM managed API. Adding new permission levels works as expected, but when i try to edit base permission for an existing permission level nothing happens.
Here is the code sample:
var rd = _web.RoleDefinitions.GetByName("Custom PL");
_context.Load(rd,
definition => definition.BasePermissions,
definition => definition.Description,
definition => definition.Name);
_context.ExecuteQuery();
rd.BasePermissions.Set(PermissionKind.CreateGroups);
rd.Update();
_web.Update();
_context.ExecuteQuery();I have found a similar question here https://social.technet.microsoft.com/Forums/en-US/0f2ee878-e2ca-4666-97eb-c4e6f95ad44d/add-a-base-permission-to-an-existing-role-definition-in-sharepoint-using-csom?forum=sharepointgeneral. The solution to delete and recreate the permission level is not acceptable. It would mean that all existing permission assignments with the current level would be lost!
Best regards