Creating a task with special permissions

Does anybody have suggestions on how to update custom workflow task item
permissions? The SpecialPermissions property available while creating a
task. It's an HybridDictionary but there's no documentation available
on the topic. Anyone ever used this?
[271 byte] By [AlexanderShiryaev] at [2007-12-30]
# 1

Hi

When you create task use (CreateTask Method, or OnReplicatorChildDataInitialize)

point SpecialPermissions property to

public System.Collections.Specialized.HybridDictionary createTask_SpecialPermissions

and when create task use

createTask_SpecialPermissions = new System.Collections.Specialized.HybridDictionary();

createTask_SpecialPermissions[taskOwner.LoginName] = SPRoleType.Contributor; // repeat this step for all users

createTask_SpecialPermissions[user1.LoginName] = SPRoleType.Reader; ....

Mike

Mikaelo at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Workflow...
# 2

I tried this solution, it gets compiled, but I still can change the task with another user.

Note: I have a custom InfoPath-Form assigned to this TaskType, maybe that could be a problem.

//EDIT: Ok, it works, when I have a public variable and assigned this to SpecialPermissions in the designer, but not, if I create the SpecialPermissions-Object in the CreateTask-method and assign it to the property. Maybe the designer sets a specific variable...

Uwe82 at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Workflow...
# 3
Yes can't get it to work either from VS2005 assembly; have tried the code above here and also what's in the Setting custom task list permissions post. So not sure what's going on? A bug in WSS3/MOSS?
dave.paul at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Workflow...
# 4

Did you read my Edit?

You have to define a public variable HybridDictionary(); and assign this in the workflow-designer in the SpecialPermissions-property of the CreateTask-Activity (blue exclamation mark). In the CreateTask-method, where you create a GUID an set the stuff, use the following code for example:

task1Permissions = new System.Collections.Specialized.HybridDictionary();
task1Permissions[taskVertreter.AssignedTo] =
SPRoleType.Contributor;
task1Permissions[applicant] =
SPRoleType.Reader;

It should work this way.

Uwe82 at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Workflow...
# 5

Yes thanks alot! it assigns permissions to the user for the task no bother; however the task involves the reviewer, reviewing the content of a page and assigning permissions to the listitem (page), which doesn't work unfortunately, but that's slightly different to the task permissions mentioned here. I'd love to know how/why assigning permissions to list items in workflows isn't working using the code mentioned in the list item permissions post 'Setting custom task list permissions' by Johhny H

Cheers anyway!

dave.paul at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Workflow...
# 6

Hi I have use this code and it works very good but i have a question.

How can I Update the SpecialPermissions Property In the UpdateTask Event. ?

I assing SpecialPermissions to the task when i create it same as your example:

createTask_SpecialPermissions = new System.Collections.Specialized.HybridDictionary();

createTask_SpecialPermissions[taskOwner.LoginName] = SPRoleType.Contributor; // repeat this step for all users

createTask_SpecialPermissions[user1.LoginName] = SPRoleType.Reader; ....

How can I UPDATE the SpecialPermissions of the same TASK in the UPDATE EVENT?

private void TASK1_Update(object sender, EventArgs e)

{

UpdateProp.AssignedTo = "MOSSRV\\user1";

UpdateProp.SpecialPermissions ? //doesn't Exist.

}

Do you have any Ideas. ? Thanks.

It very Important.!!!!!

ylopez at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Workflow...
# 7

You are right, there is no such property. And I really don't know how you can do this.

Maybe in this case you have to use the RoleAssignment stuff. Just search for this, I didn't use it yet and can't help you there :(

Uwe82 at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Workflow...
# 8

Uwe82 is right

Task List is a list, so you can set role assignments to list item. But you must give workflow user rights to manage task list permissions.

Mikaelo at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Workflow...
# 9

Thanks

But my case is not too easy, I first assing a TASK to an Specific Rol and Later I make an Update to the Task.

When I try to Update Task Item The Workflow Locks The Item And Permanently Blocks the task Item For users to manage it.

Does some one have done it successfully.?

I Think Is the same Issue: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1309155&SiteID=1

ylopez at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Workflow...

SharePoint Products and Technologies

Site Classified