<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for Empty Cache</title>
	<atom:link href="http://www.emptycache.com/blog/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.emptycache.com/blog</link>
	<description>a developer&#039;s blog</description>
	<lastBuildDate>Mon, 27 Apr 2009 06:44:01 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Working with Users and Groups in SharePoint 2007 by Joakim Johansson</title>
		<link>http://www.emptycache.com/blog/?p=68&#038;cpage=1#comment-3215</link>
		<dc:creator>Joakim Johansson</dc:creator>
		<pubDate>Mon, 27 Apr 2009 06:44:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.emptycache.com/blog/2008/04/18/working-with-users-and-groups-in-sharepoint-2007/#comment-3215</guid>
		<description>SPSite...how do I reference that?</description>
		<content:encoded><![CDATA[<p>SPSite&#8230;how do I reference that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Create a new alert for a SharePoint list by SharePoint 2007&#8217;s problems &#171; Huynhvothinh&#8217;s Weblog</title>
		<link>http://www.emptycache.com/blog/?p=67&#038;cpage=1#comment-3214</link>
		<dc:creator>SharePoint 2007&#8217;s problems &#171; Huynhvothinh&#8217;s Weblog</dc:creator>
		<pubDate>Wed, 04 Feb 2009 02:51:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.emptycache.com/blog/2008/04/17/create-a-new-alert-for-a-sharepoint-list/#comment-3214</guid>
		<description>[...] -http://www.emptycache.com/blog/2008/04/17/create-a-new-alert-for-a-sharepoint-list/ [...]</description>
		<content:encoded><![CDATA[<p>[...] -http://www.emptycache.com/blog/2008/04/17/create-a-new-alert-for-a-sharepoint-list/ [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on VMware Virtual Server: Geek for free by Latika</title>
		<link>http://www.emptycache.com/blog/?p=58&#038;cpage=1#comment-3210</link>
		<dc:creator>Latika</dc:creator>
		<pubDate>Wed, 29 Oct 2008 06:15:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.emptycache.com/blog/2008/02/10/vmware-virtual-server-geek-for-free/#comment-3210</guid>
		<description>Good for people to know.</description>
		<content:encoded><![CDATA[<p>Good for people to know.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Create a new alert for a SharePoint list by Pamela Willox</title>
		<link>http://www.emptycache.com/blog/?p=67&#038;cpage=1#comment-3209</link>
		<dc:creator>Pamela Willox</dc:creator>
		<pubDate>Fri, 26 Sep 2008 02:49:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.emptycache.com/blog/2008/04/17/create-a-new-alert-for-a-sharepoint-list/#comment-3209</guid>
		<description>Excellent post Adam. I hope you can help me!
I&#039;ve created an item event handler so that when someone posts an item to a list, an alert is created on that item (if it&#039;s the first post i.e fileSystemObjectType folder).
It works well if it&#039;s a site administrator creating the item, but when it&#039;s a user with member permissions, I have a problem. When it tries to set the alert template name 
I get a permission denied error.

I have tried to open the site with a user token to impersonate the site collection administrator but still having the same issue.
Here is the method for the alert up to the point it fails:

public void CreateAlert(SPWeb myWeb, SPList list, SPListItem item, string alertTitle, SPUser alertUser, bool notify)
        {
            try
            {
                    SPUserToken siteAdminToken = GetUserToken(myWeb.Url.ToString(), &quot;siteadmin&quot;);
                    using (SPSite site = new SPSite(myWeb.Site.ID, siteAdminToken))
                    {
                        SPWeb alertsWeb = site.OpenWeb(myWeb.ID);
                        SPList alertList = alertsWeb.Lists[list.ID];
                        SPListItem alertListItem = alertList.GetItemById(item.ID);
                        SPAlertCollection alerts = alertsWeb.Alerts;
                       
                        // get the lists alert template and apply that to the new alert
                        SPAlertTemplate alertTemplate = alertList.AlertTemplate;
                        alertTemplate.Name = alertList.AlertTemplate.Name;
...
}

Can you shed any light?

Regards,
Pam</description>
		<content:encoded><![CDATA[<p>Excellent post Adam. I hope you can help me!<br />
I&#8217;ve created an item event handler so that when someone posts an item to a list, an alert is created on that item (if it&#8217;s the first post i.e fileSystemObjectType folder).<br />
It works well if it&#8217;s a site administrator creating the item, but when it&#8217;s a user with member permissions, I have a problem. When it tries to set the alert template name<br />
I get a permission denied error.</p>
<p>I have tried to open the site with a user token to impersonate the site collection administrator but still having the same issue.<br />
Here is the method for the alert up to the point it fails:</p>
<p>public void CreateAlert(SPWeb myWeb, SPList list, SPListItem item, string alertTitle, SPUser alertUser, bool notify)<br />
        {<br />
            try<br />
            {<br />
                    SPUserToken siteAdminToken = GetUserToken(myWeb.Url.ToString(), &#8220;siteadmin&#8221;);<br />
                    using (SPSite site = new SPSite(myWeb.Site.ID, siteAdminToken))<br />
                    {<br />
                        SPWeb alertsWeb = site.OpenWeb(myWeb.ID);<br />
                        SPList alertList = alertsWeb.Lists[list.ID];<br />
                        SPListItem alertListItem = alertList.GetItemById(item.ID);<br />
                        SPAlertCollection alerts = alertsWeb.Alerts;</p>
<p>                        // get the lists alert template and apply that to the new alert<br />
                        SPAlertTemplate alertTemplate = alertList.AlertTemplate;<br />
                        alertTemplate.Name = alertList.AlertTemplate.Name;<br />
&#8230;<br />
}</p>
<p>Can you shed any light?</p>
<p>Regards,<br />
Pam</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on So here&#8217;s the problem with my Dell Inspirion E1505&#8230; by rg</title>
		<link>http://www.emptycache.com/blog/?p=57&#038;cpage=1#comment-3208</link>
		<dc:creator>rg</dc:creator>
		<pubDate>Sun, 03 Aug 2008 20:12:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.emptycache.com/blog/2008/02/10/so-heres-the-problem-with-my-dell-inspirion-e1505/#comment-3208</guid>
		<description>just discovered the same problem on an E1505.  WiFi enabled freezes the boop process.  Disable the WiFi and all is well.</description>
		<content:encoded><![CDATA[<p>just discovered the same problem on an E1505.  WiFi enabled freezes the boop process.  Disable the WiFi and all is well.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
