设置工作流任务的分配对象和权限为一个用户组

 

在createTask的代码中:

 

 SPGroup group= workflowProperties.Web.Groups["董事会"];
  SPFieldUserValue groupvalue = new SPFieldUserValue(group.ParentWeb, group.ID, group.Name);
  createTask1_TaskProperties1.AssignedTo = groupvalue.LookupValue;
  System.Collections.Specialized.HybridDictionary specialPerissions=new System.Collections.Specialized.HybridDictionary ();
  specialPerissions.Add (groupvalue.LookupValue,SPRoleType.Contributor);
  createTaskWithContentType1.SpecialPermissions = specialPerissions;

你可能感兴趣的:(工作流)