Unable to change base permissions for an existing role definition using CSOM

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


March 27th, 2015 2:56pm

Hi,

Try to edit Permission Levels using Powershell, here is a thread for your reference:

https://social.technet.microsoft.com/Forums/sharepoint/en-US/187f6411-bf93-47b4-9f9a-04bcd97e6944/edit-permission-levels-with-powershell-or-another-tool?forum=sharepointadminprevious

Or you can get all existing permission assignments in current level and delete it, then recreate a new one with those existing permission assignments.

Regards

Free Windows Admin Tool Kit Click here and download it now
March 30th, 2015 3:05pm

Hi,

Any update?

Best Regards

April 9th, 2015 1:41am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics