Im writing a feature to hide a document library and allow all users read only access (as taking away permissions breaks some things as im told) on activation, and the opposite on deactivation.
Permissions are not my strong suit, so im wondering if anyone has any advice? I tried googling this issue, but either I dont understand the examples or theyre not doing what I need them to do.
I know im supposed to iterate through the RoleAssignments collection in the SPWeb object, but im not sure what im supposed to do with the groups or users that I can access through that. Do I delete all groups and reasssign them all to a "read-only" group? Or is there a way to lower the permissions of everyone?
Also, on the topic of reversing this, Is there a way of resetting this? Or would the site owner be responsible for fixing everyones permissions after the feature is deactivated?
Thanks!