FBA roles and SPRoleAssignment

By 26. 3. 2015SharePoint

Still unable to set SPListItem permissions to FBA role in .Net Framework 3.5? Use the direct name of your FBA rule in claim form to make it working.

SPRoleDefinition spRole = elevatedWeb.RoleDefinitions["Read"];
SPRoleAssignment roleAssignment = new SPRoleAssignment("c:0-.f|roleprovidername|rolename", null, "rolename", null);
roleAssignment.RoleDefinitionBindings.Add(spRole);
Item.RoleAssignments.Add(roleAssignment);
Item.Update();
Trefný Luděk

Author Trefný Luděk

More posts by Trefný Luděk

Leave a Reply