<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx</link><description>Here is a piece of code (a function) to set Item Level Permission. You can use it as a Web Method in a custom Web Service. This method can be used from Applications outside of SharePoint, provided the user using this application has sufficient privilege</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#4190145</link><pubDate>Thu, 02 Aug 2007 18:09:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4190145</guid><dc:creator>taki</dc:creator><description>&lt;p&gt;Well, where do you insert this code?&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#4208295</link><pubDate>Fri, 03 Aug 2007 18:22:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4208295</guid><dc:creator>pranab</dc:creator><description>&lt;p&gt;Hi Taki,&lt;/p&gt;
&lt;p&gt;This code can be used by the administrator or users with sufficient privilege to change item level permission for the other users. This code can be implemented in a custom web part, in an application (Layouts) page or in a custom web services.&lt;/p&gt;
</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#4282653</link><pubDate>Tue, 07 Aug 2007 23:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4282653</guid><dc:creator>david</dc:creator><description>&lt;p&gt;How could you use this code to restrict permission to a folder or document level of a document library?&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#4380475</link><pubDate>Tue, 14 Aug 2007 10:45:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4380475</guid><dc:creator>Garry Jay</dc:creator><description>&lt;p&gt;Thanks for the useful code. But in some cases it's much better to take some tools that can make just the same thing in several clicks. In this situation I would use something like &amp;lt;a href=&amp;quot;&lt;a rel="nofollow" target="_new" href="http://dl.scriptlogic.com/landing/beta/Security-Explorer-for-SharePoint.aspx&amp;quot;&amp;gt;security"&gt;http://dl.scriptlogic.com/landing/beta/Security-Explorer-for-SharePoint.aspx&amp;quot;&amp;gt;security&lt;/a&gt; explorer for SharePoint&amp;lt;/a&amp;gt;. I found this tool not too long ago but I'm amazed at how it makes common permission operations easier. For example, using tree-like view of SharePoint farm and all sites you can manage SharePoint security permissions, permission levels and SharePooint groups in the most easiest and visual way.&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#4686470</link><pubDate>Sat, 01 Sep 2007 14:36:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4686470</guid><dc:creator>Krishna</dc:creator><description>&lt;p&gt;Hi Pranab,&lt;/p&gt;
&lt;p&gt;This code works superbly when i want to assign permission for a individual user.&lt;/p&gt;
&lt;p&gt;How can i modify &amp;amp; use this code to set ItemLevel Permissin for a share point group (instead of a person as u did in above code)&lt;/p&gt;
&lt;p&gt;Your suggestion will help a lot.&lt;/p&gt;
&lt;p&gt;Thanks and Regards&lt;/p&gt;
&lt;p&gt;Krishna&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#4778313</link><pubDate>Thu, 06 Sep 2007 07:15:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4778313</guid><dc:creator>Jaya Borra</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt; thanks for the useful code. Can you please tell me how can I use the code for setting page level permission instead of item level? Its very urgent for me, I am trying to find the solution from past 2 days. If you know any way can you please guide me in right direction?&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;
&lt;p&gt;Jaya Borra.&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#5242448</link><pubDate>Tue, 02 Oct 2007 16:45:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5242448</guid><dc:creator>Vivek  Soni</dc:creator><description>&lt;p&gt;How can i set the permission for a group of people.&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#5261095</link><pubDate>Wed, 03 Oct 2007 15:27:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5261095</guid><dc:creator>Sowmya</dc:creator><description>&lt;p&gt;Hi ,&lt;/p&gt;
&lt;p&gt;How to Set permissions for individual versions of a Document&lt;/p&gt;
&lt;p&gt;Sowmya&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#5388934</link><pubDate>Wed, 10 Oct 2007 07:31:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5388934</guid><dc:creator>Venkat</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;We have a client requirement. The client created a default template where in he will specify the each user role for document library under project site. So when the client creates a new project site, the permissions for each of document library should inherit from this custom template rather than MOSS default permission settings. Is it possible to programatically over ride the MOSS default permission setting and give rights using custom template? &lt;/p&gt;
&lt;p&gt;Please let us know the details (including table names, sample code if possible)&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#5781255</link><pubDate>Tue, 30 Oct 2007 17:34:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5781255</guid><dc:creator>CorumMc</dc:creator><description>&lt;p&gt;Thanks for the code. Is there a way to set permissions to a view? I have a registration form with several views filtered by a dropdown list of locations. I need to restrict various groups read access to this list to only see the view sorted by their location. &lt;/p&gt;</description></item><item><title>How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically Part 2</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#7698074</link><pubDate>Thu, 14 Feb 2008 21:47:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7698074</guid><dc:creator>Pranab Paul's Blog - SharePoint 2007 (MOSS/WSS 3.0) Development Tips </dc:creator><description>&lt;p&gt;Requirement: I have a list and have made settings wherein the user can edit only the items created by&lt;/p&gt;
</description></item><item><title>How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically (Part 2)</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#7698353</link><pubDate>Thu, 14 Feb 2008 22:05:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7698353</guid><dc:creator>Noticias externas</dc:creator><description>&lt;p&gt;Requirement: I have a list and have made settings wherein the user can edit only the items created by&lt;/p&gt;
</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#7845383</link><pubDate>Fri, 22 Feb 2008 09:33:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7845383</guid><dc:creator>deepakbadki@gmail.com</dc:creator><description>&lt;p&gt;Thanks for the code snippet.&lt;/p&gt;
&lt;p&gt;This code uses SP Object Model. What if I dont have access to SP Server and I cannot deploy the custom web service. Is there any way to implement the same functionality using WSS Web Service?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Deepak&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#8204439</link><pubDate>Fri, 14 Mar 2008 17:56:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8204439</guid><dc:creator>Raja</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I converted your code into console app to test&lt;/p&gt;
&lt;p&gt;once I ran the code (no errors while executing) try to see like browse user permissions and other pages system says “file not found!!”&lt;/p&gt;
&lt;p&gt;do you know how to fix , Appreciate your help&lt;/p&gt;
&lt;p&gt;My Env. Moss 2007, Single farm&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Raja&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#8327941</link><pubDate>Fri, 21 Mar 2008 00:17:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8327941</guid><dc:creator>Crucial</dc:creator><description>&lt;p&gt;Someone above was wondering how to establish the above example with a group.&lt;/p&gt;
&lt;p&gt;Simply replace:&lt;/p&gt;
&lt;p&gt;SPRoleAssignment RoleAssignment = new SPRoleAssignment(&amp;quot;&amp;lt;domain&amp;gt;\\&amp;lt;user&amp;gt;&amp;quot;, &amp;quot;email&amp;quot;, &amp;quot;name&amp;quot;, &amp;quot;notes&amp;quot;);&lt;/p&gt;
&lt;p&gt;RoleAssignment.RoleDefinitionBindings.Add(RoleDefinition);&lt;/p&gt;
&lt;p&gt;With the following:&lt;/p&gt;
&lt;p&gt;SPGroup spGroup = WebApp.Groups[&amp;quot;NameOfGroup&amp;quot;];&lt;/p&gt;
&lt;p&gt;SPRoleAssignment RoleAssignment = new SPRoleAssignment(spGroup);&lt;/p&gt;
&lt;p&gt;RoleAssignment.RoleDefinitionBindings.Add(RoleDefinition);&lt;/p&gt;
&lt;p&gt;item.RoleAssignments.Add(roleAssignment );&lt;/p&gt;
&lt;p&gt;Everything else should be the same.&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#8339669</link><pubDate>Thu, 27 Mar 2008 16:51:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8339669</guid><dc:creator>Liham</dc:creator><description>&lt;p&gt;Hi Great Thanks a lot&lt;/p&gt;
&lt;p&gt;Can i use this in an eventhandler itemadded ?&lt;/p&gt;
&lt;p&gt;Good Day&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#8481069</link><pubDate>Fri, 09 May 2008 20:26:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8481069</guid><dc:creator>beekermd03</dc:creator><description>&lt;p&gt;I was wondering if you knew a way to set permissions to a customized page. &amp;nbsp;I created a custom page and attached a master page using SPD. &amp;nbsp;My entire site is public facing, and several areas are accessible. &amp;nbsp;I have lists that are locked down by permission based and was wondering if I could apply that permission idea to an individual page. &amp;nbsp;Do you know if this is possible? &amp;nbsp;Any ideas would be great!&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#8571553</link><pubDate>Tue, 03 Jun 2008 17:10:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8571553</guid><dc:creator>Nilesh Thakkar</dc:creator><description>&lt;p&gt;Thanks for the article.&lt;/p&gt;
&lt;p&gt;I want to set item level permission, but without using SP Object Model. Is there any way to do the same thing without using SP Object model, by Using WSS Web Service ??&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Nilesh Thakkar&lt;/p&gt;
&lt;p&gt;nilesh_mscit@hotmail.com&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#8626423</link><pubDate>Fri, 20 Jun 2008 21:46:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8626423</guid><dc:creator>swati khera</dc:creator><description>&lt;p&gt;i am new to MOSS.I want to assign permission for the selected item (which user selects ).Please let me know how to access it through your code .&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#9047071</link><pubDate>Thu, 06 Nov 2008 08:47:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9047071</guid><dc:creator>SrinivasReddy</dc:creator><description>&lt;p&gt;How to set the Item level permissions using out of the box webservice in moss 2007?&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#9364981</link><pubDate>Thu, 22 Jan 2009 11:42:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9364981</guid><dc:creator>Shady</dc:creator><description>&lt;p&gt;hi there &lt;/p&gt;
&lt;p&gt;according to this site : &lt;a rel="nofollow" target="_new" href="https://blogs.pointbridge.com/Blogs/morse_matt/Pages/Post.aspx?_ID=8#EntryTabs"&gt;https://blogs.pointbridge.com/Blogs/morse_matt/Pages/Post.aspx?_ID=8#EntryTabs&lt;/a&gt; but with no luck :( &lt;/p&gt;
&lt;p&gt;can you show me how to do that in moss ? what im trying to do is im creating a doc that is attached with a workflow , once the item is created i just want me and the approvers to see that document ! , how can that be done ? any help please :( &lt;/p&gt;
&lt;p&gt;in other words i want list security permissions to be on a DOC ( library ) , how can that be done ? &lt;/p&gt;
&lt;p&gt;thanks &lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#9399168</link><pubDate>Thu, 05 Feb 2009 20:18:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9399168</guid><dc:creator>PJMueller</dc:creator><description>&lt;p&gt;How do you add a group that is in AD, but not explicitely set up as a SharePoint group? &amp;nbsp;You can do this if you go into SharePoint, however i need to do it programmatically. &amp;nbsp;thx&lt;/p&gt;</description></item><item><title>How to set or restrict Permissions to groups for SharePoint Views</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#9442246</link><pubDate>Tue, 24 Feb 2009 09:29:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9442246</guid><dc:creator>Jeena</dc:creator><description>&lt;p&gt;HI &lt;/p&gt;
&lt;p&gt;I have created specific Views in the particular SP site and now I need to ensure that my client can access only specific views that are meant for their eyes. I do not want them to See or access the other views from the View drop-down. Is there a way to restrict acces to views? I tried by creating a new library and then copying the .aspx view file but it did not work. &lt;/p&gt;
&lt;p&gt;Appreciate your help.&lt;/p&gt;
&lt;p&gt;Thanks much&lt;/p&gt;
&lt;p&gt;Jeena &lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#9535051</link><pubDate>Tue, 07 Apr 2009 06:12:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9535051</guid><dc:creator>pete w</dc:creator><description>&lt;p&gt;Sorry to be nitpicky, but you should be using the using(...){}&lt;/p&gt;
&lt;p&gt;blocks in there to ensure those unmanaged objects are properly disposed.&lt;/p&gt;
&lt;p&gt;Thanks for the code example though I get the point&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#9817366</link><pubDate>Sat, 04 Jul 2009 10:50:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9817366</guid><dc:creator>Ali</dc:creator><description>&lt;p&gt;Hi thanks in advance, i have a document library in which arround 1 lac documents are there, in 1 lac document arround on 250 document i want to apply permission, all document has fields filled, the 250 documents on which i want to apply permissions &amp;nbsp;have got a field which is unique, now i want to assign permission on bulk basis, in a single click or through program, can you please help how to achieve this.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#9822247</link><pubDate>Tue, 07 Jul 2009 14:03:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9822247</guid><dc:creator>shafaqat</dc:creator><description>&lt;p&gt;hi&lt;/p&gt;
&lt;p&gt;how can we add filed level permissions for users and groups. My list has some fields, i want to show some fields to UserA and some other Fields to UserB, is it possible to do so, thanx&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#9858730</link><pubDate>Thu, 06 Aug 2009 08:26:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9858730</guid><dc:creator>Geetha</dc:creator><description>&lt;p&gt;can u pls tell me how to provide access for the user to a site programatically??&lt;/p&gt;
&lt;p&gt;i tried with the following code, permissions are assigned and i can view the name in the permissions page of site settings, but the user cannot able to access the site.&lt;/p&gt;
&lt;p&gt;SPSite site = new SPSite(&amp;quot;mysite&amp;quot;);&lt;/p&gt;
&lt;p&gt;// Opening the website : - (Actually we are making site live for getting the interface.&lt;/p&gt;
&lt;p&gt;SPWeb web = site.OpenWeb();&lt;/p&gt;
&lt;p&gt;// Allowing the update without applying security constraints.&lt;/p&gt;
&lt;p&gt;web.AllowUnsafeUpdates = true;&lt;/p&gt;
&lt;p&gt;web.SiteUsers.Add(&amp;quot;domain\\user&amp;quot;, &amp;quot;useremail&amp;quot;, &amp;quot;useremail&amp;quot;, &amp;quot;notes&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;web.Update();&lt;/p&gt;
&lt;p&gt; SPPrincipal user = null;&lt;/p&gt;
&lt;p&gt;user = web.AllUsers[&amp;quot;domain\\user&amp;quot;];&lt;/p&gt;
&lt;p&gt;// Getting user for assigning the the role. &amp;nbsp;&lt;/p&gt;
&lt;p&gt; SPUser spuser = null;&lt;/p&gt;
&lt;p&gt; // Getting user properties from sharepoint.&lt;/p&gt;
&lt;p&gt;spuser = web.AllUsers[&amp;quot;domain\\user&amp;quot;];&lt;/p&gt;
&lt;p&gt;spuser.Update();&lt;/p&gt;
&lt;p&gt;// Getting role definitions information.&lt;/p&gt;
&lt;p&gt;SPRoleDefinition roleDefinition = null;&lt;/p&gt;
&lt;p&gt;roleDefinition = web.RoleDefinitions.GetByType(SPRoleType.Reader); //web.RoleDefinitions[&amp;quot;Full Control&amp;quot;];&lt;/p&gt;
&lt;p&gt;// Creating collections of roles&lt;/p&gt;
&lt;p&gt;SPRoleDefinitionBindingCollection roleDefinitionBindings = new SPRoleDefinitionBindingCollection();&lt;/p&gt;
&lt;p&gt; roleDefinitionBindings.Add(roleDefinition);&lt;/p&gt;
&lt;p&gt; // Assigning the role to user.&lt;/p&gt;
&lt;p&gt; SPRoleAssignment roleAssignment = new SPRoleAssignment(user); &amp;nbsp;&lt;/p&gt;
&lt;p&gt; roleAssignment.ImportRoleDefinitionBindings(roleDefinitionBindings);&lt;/p&gt;
&lt;p&gt; &amp;nbsp;web.RoleAssignments.Add(roleAssignment);&lt;/p&gt;
&lt;p&gt; web.Update();&lt;/p&gt;
&lt;p&gt; web.EnsureUser(&amp;quot;domain\\user&amp;quot;);&lt;/p&gt;
&lt;p&gt;kindly help ASAP.&lt;/p&gt;</description></item><item><title>re: How to set Item Level Permission for SharePoint 2007 (MOSS/WSS) List/Document Library Programmatically</title><link>http://blogs.msdn.com/pranab/archive/2007/07/04/how-to-set-item-level-permission-for-moss-wss-list-document-library-programmatically.aspx#9932636</link><pubDate>Fri, 04 Dec 2009 17:26:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9932636</guid><dc:creator>saritha</dc:creator><description>&lt;p&gt;Can anyone help me how to get list of groups user present in so that i can give permissions to all of his groups including him.Thanks&lt;/p&gt;</description></item></channel></rss>