blogs.conchango.com

welcome to the conchango blogging site
Welcome to blogs.conchango.com Sign in | Join | Help
in Search

Jomit's Blog

Technical Enthusiast

Windows Sharepoint Services (WSS) - Groups, Roles & User management API’s

 

 

Last week I worked on a pretty basic Sharepoint requirement but while developing the solution I came across few interesting things which I am going to share here.

 

Requirement:
The overall requirement was to provide a document sharing web application which can be accessed by different types of users with different permissions on different documents. Also all these users would be stored in SQL Server database.

 

Solution:
My solution to this was to create a set of Groups and Document Libraries in Sharepoint. Assign Groups to Document Libraries with Specific permissions and then add Users to these Groups via a Custom Membership Provider.  Here is how I am implementing it.

 

Initial MOSS Configuration:

The next steps were to write the following pieces of interesting code:

 

[Create Site Groups]

 

 Create Sharepoint Groups


[Assign Site Level Roles to Groups]

 

Assing Roles to Group 


 

[Add Groups to Document Libraries with Roles]

 

Add Groups to Document Library 


The important thing to note here is the “BreakRoleInheritance” method which I had to add to remove this error:
This operation is not allowed on a object that inherits permissions.”


 

[Add Users to Groups]

  

 Add Users to Groups 

 
The field “loginName” here accepts a semicolon delimited string where the first value is the ‘CustomMembershipProvider’ name assigned in the web.config file.

 

 

Apart from few initial configuration issues in the FBA the code is now working all ok in the Proof Of Concept project. I am going to integrate the same in my LIVE Project and would post any more useful stuff.

 

 

 

Published 31 March 2008 06:41 by Jomit.Vaghela

Comments

No Comments
Anonymous comments are disabled
Powered by Community Server (Personal Edition), by Telligent Systems