Skip to main content

IntraNoggin

Go Search
My Local Broadband
CodePlex
  

Ryan Miller's Blog.  Owner of My Local Broadband LLC (www.mylocalbroadband.com)
Custom Designer Workflow Impersonation

You know that all the built in SharePoint Designer workflow activities (declarative workflows) impersonate the user that started the workflow.

If you write your own SPD workflow activities, and you want them to behave the same way, then don't forget to pass CurrentUser.UserToken into any new SPSites you are using.

Consider the below example of an Execute function that sets the title of a site. If you change this line:

using (SPSite site = new SPSite(SiteURL, __Context.Web.CurrentUser.UserToken))

to this:

using (SPSite site = new SPSite(SiteURL))

 

then the code that updates the title will be running as your workflow's privileged account, just as though you were using a RunWithElevatedPriviledges block.

SPSecurity.RunWithElevatedPrivileges(delegate(){ });

 

 

protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)

{

try

{

using (SPSite site = new SPSite(SiteURL, __Context.Web.CurrentUser.UserToken))

{

using (SPWeb web = site.OpenWeb())

{

if (string.IsNullOrEmpty(NewTitle))

{

NewTitle = "";

}

 

string oldTitle = web.Title;

web.Title = NewTitle;

web.Update();

 

string message = "Site: " + SiteURL + "; renamed from " + oldTitle + " to " + NewTitle;

WorkflowHistoryLogger.LogMessage(executionContext, SPWorkflowHistoryEventType.None, "Complete", UserID, message);

}

}

}

catch (Exception ex)

{

WorkflowHistoryLogger.LogError(executionContext, UserID, ex);

return ActivityExecutionStatus.Faulting;

}

return ActivityExecutionStatus.Closed;

}

My Machine has been infected by Zombies

I was trying to debug a workflow activity feature when I found out.

I clicked Yes. I hope it was a head shot or these things will just keep coming back.

1 free month for friends and family! Offer expires June 15th.

 

 

There's still time...but not much!

Dear Ryan,

Who wouldn't like a free month of movies? Forward this email to your =family and friends, and they'll get a FREE month of Netflix. That's =twice as long as our regular free trial!


Hurry, offer expires 06/15/2009.

–Your= friends at Netflix

 

Treat your friends and family!

 

One FREE month of Netflix!

Middle Spacer

One FREE month of Netflix!

right border

From:<=/b>
Ryan Miller

Good for: 1 month of Netflix
EXPIRES:
06/15/2009
(Quantities are limited)

Redeem Button

One FREE month of Netflix!

 

How Netflix works

 

Free Trial Offer: Expires June 15, =2009. Cannot be combined with any other offer. Current and previous members =and their households are ineligible. Internet access and valid payment =method required to redeem offer. Free Trial lasts for one month. Netflix will =begin to bill your payment method for the Netflix plan selected at sign-up =at the completion of the free trial unless you cancel prior to the end of the =free trial. Subscription Periods: Your Netflix membership is a =month-to-month subscription that you can cancel at any time. Click the "Your Account" button for cancellation instructions. No refunds or =credits for partial monthly subscription periods. Membership & Trial Plans: =The number of DVDs out at a time varies by plan. For example, 3 DVDs out at-a-time is $16.99 a month plus applicable tax. Blu-ray: An =additional monthly fee applies for Blu-ray access. Delivery: One business day =delivery based on more than 97% of our members being within one-day postal =delivery zones. For more details: Please visit www.netflix.com/TermsOfUse for =complete terms and conditions, including shipping and delivery details. Netflix reserves the right to change terms and conditions at any time.

SRC: 20090602TAFA
(c)1997-2009 Netflix, Inc. 100 Winchester Circle, Los Gatos, CA 95032 =

This promotional message was mailed to [ryanlmiller@gmail.com]. If =this is your email address and you would like to unsubscribe from Netflix =Offers Via Email, please visit the Email Subscriptions page in your account. If this is not your address, =this message was forwarded to you by your friend, and there is no need to unsubscribe.

What I’m Listening to: My New Zune

I forgot how much I love having a Zune.  This one arrived yesterday from woot.com last week.  The car adapter should arrive today.  WOOT!

Oh, and I do think it's cool that the Zune software on the PC knows what color Zune I've got and shows it on screen when I connect it.

SharePoint Workflow White Paper Available

I’ve just released a white paper on the options available for creating SharePoint 2007 workflows.  You can grab a copy from the documents section in this blog.

Introduction:

When it comes to building SharePoint workflow into a site, options are plentiful. Choosing the right option can make a world of difference to your project’s bottom line and your client’s satisfaction. In this paper I’ll go over four “no-code” solutions and three .NET coding options and try to give you some consideration points to help you choose between them.

Who Should Read this Paper:
  • Governance committees when making decisions about what methods of workflow to endorse and support
  • SharePoint Site Owners
  • SharePoint .NET Developers
  • IT Managers wondering what SharePoint Workflow can do for them
  • My wife, my family members, & anyone else wondering what it is I do for a living
1 - 5 Next

 ‭(Hidden)‬ Admin Links

 New Links

There are currently no favorite links to display.

 Links

Expand/Collapse Category ‎(11)
Expand/Collapse CategoryEnvironment ‎(2)
Expand/Collapse CategoryOther Blogs ‎(9)
Expand/Collapse CategoryProducts ‎(10)
Expand/Collapse CategorySharePoint ‎(31)
Expand/Collapse CategoryThis Site ‎(5)
www.flickr.com
This is a Flickr badge showing public photos and videos from Intranoggin. Make your own badge here.