Subscribe:      
 

How to Programmatically Set User And Group Permissions

Written By: Ivan Ivanov -- 10/5/2011 -- join -- contribute -- (0) comments -- printer friendly version

Rating: Rate --

Categories: Design, MOSS 2007, Permission Management, Programming and Customizations, Visual Studio, Web Parts, WSS3

< Prev - 1 | 2 | 3 | 4 | 5 | 6 | - Next > | Become a paid author

After a response is made by the manager we have to set the creator and manager to read only permissions . To fulfill these requirements we have to write the method SetUserPermissionOnEdit and call it in the GetItem method.

The implementation of SetUserPermissionOnEdit is shown bellow.



Next we build, package and deploy solution.



Create a new web part page and add the WPHolidayNew webpart. Create another page and add the  WPHolidayEdit webpart.

Let’s assume we have user with a login name of usr1 and this user is the Accounting manager. We have to put usr1 in the Accounting group.



Now we have a user with a login name of usr2. We sign in as user usr2, open the page with the WPHolidayNew webpart and submit a request.


< Prev - 1 | 2 | 3 | 4 | 5 | 6 | - Next >



Learn more about SharePoint



Sponsor Information




Copyright (c) 2010-2017 Edgewood Solutions, LLC All rights reserved
privacy | disclaimer | copyright | advertise | contribute | feedback | about
Some names and products listed are the registered trademarks of their respective owners.


MSSharePointTips.com | MSSQLTips.com