Monday, July 6, 2009


Hi all

Recently i tried to copy permission from one item to another (see How To Copy Permissions Between Site Collections) , and had a problem with role definition types that were None.
The problem occured when i tried to copy
Restricted Read role agginment.

So to solve it I used this code:

if (roleDefinition.Type != SPRoleType.None)
definition = web.RoleDefinitions.GetByType(roleDefinition.Type);
definition = web.RoleDefinitions.GetById(roleDefinition.Id);

Instead of geting the code by role definition type i got it by it's Id.

No comments:

Post a Comment