<?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>mylifeinaminute.com &#187; .NET</title>
	<atom:link href="http://www.mylifeinaminute.com/tag/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mylifeinaminute.com</link>
	<description>You can learn a lot in a minute</description>
	<lastBuildDate>Wed, 18 Jan 2012 02:33:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Microsoft Web Platform Installer</title>
		<link>http://www.mylifeinaminute.com/2008/12/01/microsoft-web-platform-installer/</link>
		<comments>http://www.mylifeinaminute.com/2008/12/01/microsoft-web-platform-installer/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 15:24:21 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Internet Information Services]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Server 2003]]></category>
		<category><![CDATA[Server 2008]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Web Platform Installer]]></category>

		<guid isPermaLink="false">http://www.mylifeinaminute.com/?p=223</guid>
		<description><![CDATA[Microsoft has just released the Web Platform Installer (RC1).   What is the Web Platform Installer you ask?  From Microsoft: &#8220;The Web Platform Installer (Web PI) is a simple tool that installs Microsoft&#8217;s entire Web Platform, including IIS7, Visual Web Developer 2008 Express Edition, SQL Server 2008 Express Edition and the .NET Framework. Using the Web [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Microsoft" href="/tag/microsoft/">Microsoft</a> has just released the <a title="Microsoft Web Platform Installer (RC1)" href="http://www.microsoft.com/web/channel/products/WebPlatformInstaller.aspx">Web Platform Installer (RC1)</a>.   What is the <a title="Microsoft Web Platform Installer (RC1)" href="http://www.microsoft.com/web/channel/products/WebPlatformInstaller.aspx">Web Platform Installer</a> you ask?  From <a title="Microsoft" href="/tag/microsoft/">Microsoft</a>:</p>
<blockquote><p>&#8220;The Web Platform Installer (Web PI) is a simple tool that installs Microsoft&#8217;s entire Web Platform, including IIS7, Visual Web Developer 2008 Express Edition, SQL Server 2008 Express Edition and the .NET Framework. Using the Web Platform Installer’s user interface, you can choose to install either specific products or the entire Microsoft Web Platform onto your computer. The Web PI also helps keep your products up to date by always offering the latest additions to the Web Platform.&#8221;</p></blockquote>
<p>The Web PI certainly looks promising as a quick ramp-up when setting up a development environment (or even a one-off server environment).</p>
<p><map name='google_ad_map_223_0feb153b14d1a0fb'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/223?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_223_0feb153b14d1a0fb' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=223&amp;url= http%3A%2F%2Fwww.mylifeinaminute.com%2F2008%2F12%2F01%2Fmicrosoft-web-platform-installer%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.mylifeinaminute.com/2008/12/01/microsoft-web-platform-installer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Method for Checking Permissions on a SPWeb Object</title>
		<link>http://www.mylifeinaminute.com/2008/11/21/custom-method-for-checking-permissions-on-a-spweb-object/</link>
		<comments>http://www.mylifeinaminute.com/2008/11/21/custom-method-for-checking-permissions-on-a-spweb-object/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 14:24:20 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[Sharepoint Server]]></category>
		<category><![CDATA[TechNet]]></category>
		<category><![CDATA[Visual Studio 2005]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>
		<category><![CDATA[Windows SharePoint Services]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[moss 2007]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SPBasePermissions]]></category>

		<guid isPermaLink="false">http://www.mylifeinaminute.com/?p=189</guid>
		<description><![CDATA[The out-of-the-box method DoesUserHavePermissions() on an SPWeb object does not take indirect membership into account (i.e. the current user is a member of a domain group that has access the the SPWeb being checked).  To get around this, I use the following method (DoesUserHavePermssionsToWeb(SPUser, SPWeb)): Note that in the above method is checking for SPBasePermissions [...]]]></description>
			<content:encoded><![CDATA[<p>The out-of-the-box method <a title="DoesUserHavePermissions Method" href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.doesuserhavepermissions.aspx">DoesUserHavePermissions()</a> on an SPWeb object does not take indirect membership into account (i.e. the current user is a member of a domain group that has access the the SPWeb being checked).  To get around this, I use the following method (<strong>DoesUserHavePermssionsToWeb(SPUser, SPWeb)</strong>):</p>
<p><span id="more-189"></span></p>
<pre>
<pre class="brush: csharp; title: ; notranslate">
        private bool DoesUserHavePermssionsToWeb(ref SPUser user, ref SPWeb web)
        {
            bool hasPermission = false;

            SPBasePermissions perms = this.GetPermissionsForUser(ref user, ref web);
            if (perms.ToString().Contains(SPBasePermissions.Open.ToString())
                    || perms.ToString().Contains(SPBasePermissions.FullMask.ToString()))
                hasPermission = true;
            if (!hasPermission)
            {
                // Check the users groups - this is for indirect membership;
                foreach (string groupLoginName in this.GetCurrentUserADGroups())
                {
                    try
                    {
                        SPUser groupUser = web.SiteUsers[groupLoginName];

                        perms = this.GetPermissionsForUser(ref groupUser, ref web);
                        if (perms.ToString().Contains(SPBasePermissions.Open.ToString())
                            || perms.ToString().Contains(SPBasePermissions.FullMask.ToString()))
                        {
                            hasPermission = true;
                            break;
                        }
                    }
                    catch { }
                }
            }

            return hasPermission;
        }

        private SPBasePermissions GetPermissionsForUser(ref SPUser user, ref SPWeb web)
        {
            SPBasePermissions perms = SPBasePermissions.EmptyMask;

            try
            {
                SPUserToken userToken = user.UserToken;
                System.Reflection.MethodInfo getPermissions = typeof(Microsoft.SharePoint.Utilities.SPUtility).GetMethod(&quot;GetPermissions&quot;,
                    System.Reflection.BindingFlags.NonPublic |
                    System.Reflection.BindingFlags.Public |
                    System.Reflection.BindingFlags.Instance |
                    System.Reflection.BindingFlags.InvokeMethod |
                    System.Reflection.BindingFlags.Static);

                perms = (SPBasePermissions)getPermissions.Invoke(null, new object[] { userToken, web });
            }
            catch { }

            return perms;
        }

        private System.Collections.ArrayList GetCurrentUserADGroups()
        {
			// Get the current groups for the logged in user;
            System.Collections.ArrayList groups = new System.Collections.ArrayList();
            foreach (System.Security.Principal.IdentityReference group in System.Web.HttpContext.Current.Request.LogonUserIdentity.Groups)
            {
                groups.Add(group.Translate(typeof (System.Security.Principal.NTAccount)).ToString());
            }
            return groups;
        }
</pre>
</pre>
<p>Note that in the above method is checking for <a title="SPBasePermissions Enumeration" href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spbasepermissions.aspx">SPBasePermissions</a> of Open and FullMask.</p>
<p>The supporting methods are also included.  After checking the permissions on the web object for the current logged in user, if not permissions have been granted we continue to check each Active Directory group that the current user is a member of.</p>
<p><map name='google_ad_map_189_0feb153b14d1a0fb'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/189?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_189_0feb153b14d1a0fb' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=189&amp;url= http%3A%2F%2Fwww.mylifeinaminute.com%2F2008%2F11%2F21%2Fcustom-method-for-checking-permissions-on-a-spweb-object%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.mylifeinaminute.com/2008/11/21/custom-method-for-checking-permissions-on-a-spweb-object/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: www.mylifeinaminute.com @ 2012-02-05 09:28:32 by W3 Total Cache -->
