Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

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

$
0
0

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



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>