Creating a task with special permissions
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?
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
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...
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();It should work this way.
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!
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.!!!!!
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 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.
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