<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>David&#039;s technobabble &#187; security</title>
	<atom:link href="http://bable.cybermarshall.com/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://bable.cybermarshall.com</link>
	<description>David&#039;s thoughts about this and that</description>
	<lastBuildDate>Fri, 22 Jan 2010 18:29:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Customizing and enhancing the security of a WSS 3.0/SharePoint 2007 site</title>
		<link>http://bable.cybermarshall.com/2009/01/08/customizing-and-enhancing-the-security-of-a-wss-30sharepoint-2007-site/</link>
		<comments>http://bable.cybermarshall.com/2009/01/08/customizing-and-enhancing-the-security-of-a-wss-30sharepoint-2007-site/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 04:00:14 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[conditional]]></category>
		<category><![CDATA[rendering]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[WSS 3.0]]></category>

		<guid isPermaLink="false">http://bable.cybermarshall.com/?p=272</guid>
		<description><![CDATA[I wanted to compare the capabilities of WSS 3.0 (Sharepoint 2007) to host forum-like discussions, blogs and wiki&#8217;s. After I&#8217;d developed my site, there were items that were visible to anonymous and standard users that I felt were inappropriate. I wanted information to be visible or not based upon the users role. Such as the [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to compare the capabilities of WSS 3.0 (Sharepoint 2007) to host forum-like discussions, blogs and wiki&#8217;s. After I&#8217;d developed my site, there were items that were visible to anonymous and standard users that I felt were inappropriate. I wanted information to be visible or not based upon the users role. Such as the ability to view lists of People and Groups.  I&#8217;ve worked in several businesses where exposing customer names to all users is a violation of customer agreements. IMHO, this is a serious oversight in Microsoft&#8217;s implementation.<br />
<span id="more-272"></span><br />
After I did a good bit of research, experimentation and learning I was able to change the security using the SPSecurityTrimmedControl. Here is how I restricted access to some portions on my Sharepoint Site.</p>
<p>WSS 3.0 provides a control <a href="#spstrim">SPSecurityTrimmedControl</a> that allows the conditional rendering of content based on a users permission. Using this control, I was able to restrict who would be shown People and Groups on my site.  To do this I modified the <a href="#people">people.aspx</a> and the <a href="#groups">groups.aspx</a> files for my site.</p>
<p><em>A word of caution: I have no doubt that when applying a future service pack, Microsoft will overwrite my changes. Therefore I&#8217;m managing my changes externally from the Microsoft SharePoint directory. This will allow me to difference new code from Microsoft and reapply my changes.</em></p>
<p><a id="people" name="people"></a><br />
<strong>people.aspx</strong><br />
The file people.aspx resides in the <span style="text-decoration: underline;"><em>\Program Files\Common Files\Microsoft Shared\web server  extensions\12\TEMPLATE\LAYOUTS</em></span> folder. It lists the persons in the site. After I made a backup copy, I opened the file in a text editor and located the start of the &#8220;PlaceHolderMain&#8221; asp:Content section and added the start of my permission change</p>
<p>before</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p272code6'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2726"><td class="code" id="p272code6"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;asp:Content</span> <span style="color: #000066;">contentplaceholderid</span>=<span style="color: #ff0000;">&quot;PlaceHolderMain&quot;</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;asp:PlaceHolder</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;PanelAllPeople&quot;</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;ms-listdescription&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></pre></td></tr></table></div>

<p>after</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p272code7'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2727"><td class="code" id="p272code7"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;asp:Content</span> <span style="color: #000066;">contentplaceholderid</span>=<span style="color: #ff0000;">&quot;PlaceHolderMain&quot;</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SharePoint:SPSecurityTrimmedControl</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span> <span style="color: #000066;">PermissionsString</span>=<span style="color: #ff0000;">&quot;ManagePermissions&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;asp:PlaceHolder</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;PanelAllPeople&quot;</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;ms-listdescription&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></pre></td></tr></table></div>

<p>I located the end of the &#8220;PlaceHolderMain&#8221; asp:Content section and completed my permission change.</p>
<p>before</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p272code8'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2728"><td class="code" id="p272code8"><pre class="xml" style="font-family:monospace;">	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;asp:HyperLink</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;LnkCallTo&quot;</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span></span>
<span style="color: #009900;">		<span style="color: #000066;">Text</span>=<span style="color: #ff0000;">&quot;&lt;%$SPHtmlEncodedResources:wss,people_callbuttontext%&gt;</span></span>&quot;
		style=&quot;visibility:hidden;display:none&quot;
		NavigateUrl=&quot;callto:&quot; /&gt;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/asp:Content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>after</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p272code9'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2729"><td class="code" id="p272code9"><pre class="xml" style="font-family:monospace;">	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;asp:HyperLink</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;LnkCallTo&quot;</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span></span>
<span style="color: #009900;">		<span style="color: #000066;">Text</span>=<span style="color: #ff0000;">&quot;&lt;%$SPHtmlEncodedResources:wss,people_callbuttontext%&gt;</span></span>&quot;
		style=&quot;visibility:hidden;display:none&quot;
		NavigateUrl=&quot;callto:&quot; /&gt;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SharePoint:SPSecurityTrimmedControl<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/asp:Content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>I also located the modifed the &#8220;PlaceHolderLeftNavBar&#8221; asp:Content and made the similar changes as above to require the user to have ManagePermissions as well.</p>
<p><a id="groups" name="groups"></a><br />
<strong>groups.aspx</strong><br />
The file group.aspx resides in the<span style="text-decoration: underline;"><em> \Program Files\Common Files\Microsoft Shared\web server  extensions\12\TEMPLATE\LAYOUTS</em></span> folder. It lists the groups in the site.  After I made a backup copy, I opened the file in a text editor and made the same &#8220;PlaceHolderMain&#8221; asp:Content section changes as I had to <a href="#people">people.aspx</a>.</p>
<p><a id="spstrim" name="spstrim"></a><br />
<strong>Overview of SPSecurityTrimmedControl</strong></p>
<p>The SPSecurityTrimmedControl conditionally renders the included contents only when the current user has the permissions defined by the PemissionsString.<br />
An example requiring the user to have &#8220;ManagePermissions&#8221;:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p272code10'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p27210"><td class="code" id="p272code10"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Sharepoint:SPSecurityTrimmedControl</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span> <span style="color: #000066;">PermissionsString</span>=<span style="color: #ff0000;">&quot;ManagePermissions&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">...</span>
<span style="color: #808080; font-style: italic;">... code being managed ...</span>
<span style="color: #808080; font-style: italic;">...</span>
<span style="color: #808080; font-style: italic;">--&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SharePoint:SPSecurityTrimmedControl<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Here are some of the values for the PermissionsString</p>
<table border="0">
<tbody>
<tr>
<td><em><strong>Permissions String</strong></em></td>
<td><em><strong>Description</strong></em></td>
</tr>
<tr>
<td>AddAndCustomizePages</td>
<td>Add, change, or delete HTML pages or Web Part Pages, and edit the Web site using a Windows SharePoint Services–compatible editor.</td>
</tr>
<tr>
<td>AddDelPrivateWebParts</td>
<td>Add or remove personal Web Parts on a Web Part Page.</td>
</tr>
<tr>
<td>AddListItems</td>
<td>Add items to lists, add documents to document libraries, and add Web discussion comments.</td>
</tr>
<tr>
<td>ApproveItems</td>
<td>Approve a minor version of a list item or document.</td>
</tr>
<tr>
<td>BrowseDirectories</td>
<td>Enumerate files and folders in a Web site using Microsoft Office SharePoint Designer 2007 and WebDAV interfaces.</td>
</tr>
<tr>
<td>BrowseUserInfo</td>
<td>View information about users of the Web site.</td>
</tr>
<tr>
<td>CancelCheckout</td>
<td>Discard or check in a document which is checked out to another user.</td>
</tr>
<tr>
<td>CreateAlerts</td>
<td>Create e-mail alerts.</td>
</tr>
<tr>
<td>CreateGroups</td>
<td>Create a group of users that can be used anywhere within the site collection.</td>
</tr>
<tr>
<td>DeleteListItems</td>
<td>Delete items from a list, documents from a document library, and Web discussion comments in documents.</td>
</tr>
<tr>
<td>DeleteVersions</td>
<td>Delete past versions of a list item or document.</td>
</tr>
<tr>
<td>EditListItems</td>
<td>Edit items in lists, edit documents in document libraries, edit Web discussion comments in documents, and customize Web Part Pages in document libraries.</td>
</tr>
<tr>
<td>EditMyUserInfo</td>
<td>Allows a user to change his or her user information, such as adding a picture.</td>
</tr>
<tr>
<td>EnumeratePermissions</td>
<td>Enumerate permissions on the Web site, list, folder, document, or list item.</td>
</tr>
<tr>
<td>ManageAlerts</td>
<td>Manage alerts for all users of the Web site.</td>
</tr>
<tr>
<td>ManageLists</td>
<td>Create and delete lists, add or remove columns in a list, and add or remove public views of a list.</td>
</tr>
<tr>
<td>ManagePermissions</td>
<td>Create and change permission levels on the Web site and assign permissions to users and groups.</td>
</tr>
<tr>
<td>ManagePersonalViews</td>
<td>Create, change, and delete personal views of lists.</td>
</tr>
<tr>
<td>Open</td>
<td>Allow users to open a Web site, list, or folder to access items inside that container.</td>
</tr>
<tr>
<td>OpenItems</td>
<td>View the source of documents with server-side file handlers.</td>
</tr>
<tr>
<td>UpdatePersonalWebParts</td>
<td>Update Web Parts to display personalized information.</td>
</tr>
<tr>
<td>ViewFormPages</td>
<td>View forms, views, and application pages, and enumerate lists.</td>
</tr>
<tr>
<td>ViewListItems</td>
<td>View items in lists, documents in document libraries, and view Web discussion comments.</td>
</tr>
<tr>
<td>ViewPages</td>
<td>View pages in a Web site.</td>
</tr>
<tr>
<td>ViewUsageData</td>
<td>View reports on Web site usage.</td>
</tr>
<tr>
<td>ViewVersions</td>
<td>View past versions of a list item or document.</td>
</tr>
</tbody>
</table>
<p>The full list is on <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spbasepermissions.aspx" onclick="pageTracker._trackPageview('/outgoing/msdn.microsoft.com/en-us/library/microsoft.sharepoint.spbasepermissions.aspx?referer=');">msdn</a>.</p>
<p><center><script type="text/javascript"><!--
google_ad_client = "pub-5633552336244805";
google_ad_slot = "5649858591";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://bable.cybermarshall.com/2009/01/08/customizing-and-enhancing-the-security-of-a-wss-30sharepoint-2007-site/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
