Monday, January 21, 2008

SPBasePermission

While my friends were having fun during weekends, I was hitting my head against an issue in my application. It took me a very long time to understand and resolve the issue. But finally all well that ends well. Here is the issue. I use Visual Studio for creating a subsite under a site collection. The users are present in the site collection under "Read" role. I use impersonation to create the subsite. After creation of site, I create RoleDefinition and the RoleAssigment so that the users have all appropriate rights on the newly created subsite. I was properly breaking inheritance by using web.RoleDefinitions.BreakInheritance(false,false); The above statment was written to ensure that the "Read" role permissions are not carried over to subsite, instead subsite should use their unique permission level and unique role definition. The problem was, after creation of subsite the subsite was not accessible to the users in the specified group. Inspite of all above written measures, I was not sure what is causing this error. After trying lots of things finally I got the solution. The solution was simple as to have following permissions applied to the RoleDefinition at the time of creation SPBasePermissions.ViewListItems SPBasePermissions.AddListItems SPBasePermissions.EditListItems SPBasePermissions.DeleteListItems SPBasePermissions.OpenItems SPBasePermissions.ViewVersions SPBasePermissions.DeleteVersions SPBasePermissions.ViewFormPages SPBasePermissions.Open SPBasePermissions.ViewPages SPBasePermissions.BrowseDirectories SPBasePermissions.BrowseUserInfo SPBasePermissions.UseClientIntegration SPBasePermissions.UseRemoteAPIs SPBasePermissions.CreateAlerts SPBasePermissions.EditMyUserInfo; That resolved my issue. If anybody has same or similar issue, let me know. I would be happy to assist. Thanks, Subhash

No comments:

Post a Comment

Thank you for your feedback. I will be glad to know, if this post helped you.