private static WfAclItemCollection CreateNewAcl(IWfActivity activity, IEnumerable <IUser> targetUsers)
        {
            WfAclItemCollection result = new WfAclItemCollection();

            foreach (IUser user in targetUsers)
            {
                WfAclItem acl = new WfAclItem();

                acl.ObjectID   = user.ID;
                acl.ObjectName = user.DisplayName;
                acl.ObjectType = "Users";
                acl.ResourceID = activity.Process.ResourceID;
                acl.Source     = activity.ID;

                result.Add(acl);
            }

            return(result);
        }
        public WfAclItemCollection ToAcl(string resourceID, string source)
        {
            WfAclItemCollection result = new WfAclItemCollection();

            foreach (WfAssignee assignee in this)
            {
                WfAclItem item = new WfAclItem();

                item.ObjectID   = assignee.User.ID;
                item.ObjectName = assignee.User.DisplayName;
                item.ObjectType = SchemaType.Users.ToString();
                item.ResourceID = resourceID;
                item.Source     = source;

                result.Add(item);
            }

            return(result);
        }