Sunday, November 11, 2012

Special permissions in Workflow Create Task Activity


Many times we want to restrict a task item only to be edited by a person whom it is assigned to.

If a person has contribute access then by default there is no way that we can restrict them to update the task list item.

When you are working with create task activity and create a task, you can always create a special permission object and then assign it to the task properties.

createtaskProperties.AssignedTo = "domain\\user";
System.Collections.Specialized.HybridDictionary specialPermissions =
new System.Collections.Specialized.HybridDictionary();
specialPermissions.Add(createtaskProperties.AssignedTo,
SPRoleType.Contributor);
createTask1.SpecialPermissions = specialPermissions;

This is how you set permission on task list item to allow only assigned to person edit that task list item.

4 comments:

Sudheer said...

After long gap,very interesting post.Kudos to share point kings team

Martin Pro said...

Hi,

i exactly need this, but i dont understand where you get the createTask1 from?

Thanks

P.S.: Great Blog, i already found several times something on this!!!

Martin Pro said...

Hi,

i exactly need this, but i dont understand where you get the createTask1 from?

Thanks

P.S.: Great Blog, i already found several times something on this!!!

Martin Pro said...

Found it somewhere else, thanks anyway!!!




Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to sharepointkings@gmail.com with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to sharepointkings@gmail.com