private static void FillAURoleUsers(string roleFullCodeName, OguDataCollection <IUser> users) { WrappedAUSchemaRole role = WrappedAUSchemaRole.FromCodeName(roleFullCodeName); if (role != null) { role.FillUsers(SOARoleContext.CurrentProcess, users); } }
/// <summary> /// 如果行的内容是角色,则将这些行扩展出来 /// </summary> public SOARolePropertyRowCollection ExtractMatrixRows() { SOARolePropertyRowCollection extractedRows = new SOARolePropertyRowCollection(); bool extracted = false; if (this.Operator.IsNotEmpty()) { if (this.Operator.IndexOf(":") != -1) { switch (this.OperatorType) { case SOARoleOperatorType.Role: extracted = this.ExtractSOARoleRows(new SOARole(this.Operator), extractedRows); break; case SOARoleOperatorType.AURole: WrappedAUSchemaRole wrappedRole = WrappedAUSchemaRole.FromCodeName(this.Operator); if (wrappedRole != null) { wrappedRole.DoCurrentRoleAction(SOARoleContext.CurrentProcess, (role, auCodeName) => extracted = this.ExtractSOARoleRows(role, extractedRows)); } break; } } else { if (this.Values.GetValue(SOARolePropertyDefinition.AutoExtractColumn, false)) { switch (this.OperatorType) { case SOARoleOperatorType.Role: extracted = this.ExtractDynamicRoleMatrixRows(this.Operator, extractedRows); break; case SOARoleOperatorType.User: extracted = this.ExtractUserMatrixRows(this.Operator, extractedRows); break; } } } } //如果没有展开行,则将当前行添加到结果中 if (extracted == false) { extractedRows.Add(this); } return(extractedRows); }
/// <summary> /// 准备管理单元相关的模板 /// </summary> /// <returns></returns> private IWfActivityDescriptor PrepareAURelativeActivityDescriptor(string key) { WfActivityDescriptor templateActDesp = new WfActivityDescriptor(key, WfActivityType.NormalActivity); templateActDesp.Name = "审批"; templateActDesp.CodeName = key; templateActDesp.Properties.SetValue("IsDynamic", true); WrappedAUSchemaRole role = new WrappedAUSchemaRole(AUHelper.AUSchemaActivityMatrixRoleID) { Name = "实物管理员", Description = "实物管理员" }; WfAURoleResourceDescriptor roleDesp = new WfAURoleResourceDescriptor(role); templateActDesp.Resources.Add(roleDesp); return(templateActDesp); }