this doesn't solve all permission handling in sharepoint, but it sets a lot of groundwork that needs to be done anyway.