SPRoleAssignment Crazy Caviats
- by MOSSLover
I’m not sure if this bug exists on any other environment, but here are a few issues I ran into when trying to use SPRoleAssignment and SPGroup:     When trying to use Web.Groups[“GroupName”] it basically told me the group did not exist, so I had to change the code to use Web.SiteGroups[“GroupName”].     I could not add the Role Assignment to the Web and run a Web.Update() without adding an additional Web.AllowUnsafeUpdates= true; , however on my virtual machine I could do a Web.Update() without the extra piece of code.  I kept receiving an error in my browser stating that I should hit the back button and update my permissions.    So after fixing those two issues I was able to copy the permissions from a page item into a Site for my migration.  Hopefully, one of you can learn from my error messages if you have any issues in the future.  Technorati Tags: SPRoleAssignment,MOSS,SPGroup