<?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"
	>
<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's blog</description>
	<pubDate>Thu, 04 Dec 2008 20:32:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>Comment on VMware Virtual Server: Geek for free by Latika</title>
		<link>http://www.emptycache.com/blog/2008/02/10/vmware-virtual-server-geek-for-free/#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/2008/04/17/create-a-new-alert-for-a-sharepoint-list/#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'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's the first post i.e fileSystemObjectType folder).
It works well if it's a site administrator creating the item, but when it'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(), "siteadmin");
                    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/2008/02/10/so-heres-the-problem-with-my-dell-inspirion-e1505/#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>
