Archives

Meta

All posts tagged user roles

This is continuing the previous post. After you create the list item impersonating the current logged in user in the sharepoint site you might want to give that user only the right to read it.
After oListItem.Update(); you must run the code to do this with elevated Privileges to assign the role.

I tried to set the RoleInheritence of the list item to false: oListItem.BreakRoleInheritance(false);
but i had some problems with it. I got the error:
“Updates are currently disallowed on GET requests.”

oListItem.BreakRoleInheritance(false) sets the spweb.AllowUnsafeUpdates to false; so after this you must set it true manually again even though we did that in the code before this (in the previous post) :