protected override void OnLoad(EventArgs e) { base.OnLoad(e); string auSchemaID = Request.QueryString["auSchemaID"]; if (string.IsNullOrEmpty(auSchemaID)) throw new HttpException("必须提供有效的auSchemaID参数"); this.schema = GetAuSchema(auSchemaID); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); this.Response.Cache.SetCacheability(HttpCacheability.NoCache); this.schema = DbUtil.GetEffectiveObject <AU.AUSchema>(this.Request.QueryString["id"]); this.schemaInfoLabel.Text = this.schema.Name; this.schemaIDField.Value = this.schema.ID; }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); this.Response.Cache.SetCacheability(HttpCacheability.NoCache); this.schema = DbUtil.GetEffectiveObject<AU.AUSchema>(this.Request.QueryString["id"]); this.schemaInfoLabel.Text = this.schema.Name; this.schemaIDField.Value = this.schema.ID; }
public AUSchema GetUnitSchema() { AUSchema schema = null; AUCommon.DoDbAction(() => { schema = (AUSchema)SchemaObjectAdapter.Instance.Load(this.AUSchemaID, DateTime.MinValue); }); return(schema); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); string auSchemaID = Request.QueryString["auSchemaID"]; if (string.IsNullOrEmpty(auSchemaID)) { throw new HttpException("必须提供有效的auSchemaID参数"); } this.schema = GetAuSchema(auSchemaID); }
private static AU.AUSchema GetAuSchema(string auSchemaID) { AU.AUSchema schema = null; AU.AUCommon.DoDbAction(() => { schema = (AU.AUSchema)PC.Adapters.SchemaObjectAdapter.Instance.Load(auSchemaID); }); if (schema == null || schema.Status != MCS.Library.SOA.DataObjects.Schemas.SchemaProperties.SchemaObjectStatus.Normal) throw new PC.ObjectNotFoundException("未找到指定的管理架构,此架构可能已经被删除。"); return schema; }
private static AU.AUSchema GetAuSchema(string auSchemaID) { AU.AUSchema schema = null; AU.AUCommon.DoDbAction(() => { schema = (AU.AUSchema)PC.Adapters.SchemaObjectAdapter.Instance.Load(auSchemaID); }); if (schema == null || schema.Status != MCS.Library.SOA.DataObjects.Schemas.SchemaProperties.SchemaObjectStatus.Normal) { throw new PC.ObjectNotFoundException("未找到指定的管理架构,此架构可能已经被删除。"); } return(schema); }
private DeluxeTreeNode AddSchemaToTree(AU.AUSchema item, MCS.Web.WebControls.DeluxeTreeNodeCollection treeNodes) { DeluxeTreeNode node = new MCS.Web.WebControls.DeluxeTreeNode(item.Name, item.ID) { NodeOpenImg = ControlResources.OULogoUrl, NodeCloseImg = ControlResources.OULogoUrl, CssClass = "au-catenode", ChildNodesLoadingType = ChildNodesLoadingTypeDefine.Normal, ExtendedData = "Schema", Expanded = true }; treeNodes.Add(node); return(node); }
private void ImportSchemaRoles(MCS.Library.SOA.DataObjects.Security.SCObjectSet objectSet, IImportContext context, Operations.IFacade exec, AUSchema item) { if (this.IncludeSchemaRoles) { var roles = (from p in objectSet.Membership where p.ContainerID == item.ID && p.MemberSchemaType == AUCommon.SchemaAUSchemaRole join q in objectSet.Objects on p.ID equals q.ID select q); int total = roles.Count(); int roleCount = 0; foreach (AUSchemaRole role in roles) { roleCount++; try { context.SetSubStatusAndLog(roleCount, total, "正在添加角色:" + role.GetQualifiedName()); exec.AddAdminSchemaRole(role, item); } catch (Exception ex) { context.ErrorCount++; context.AppendLog("对角色的操作失败,原因是:" + ex.Message); } } } }
public AdminUnitsPropertyEditorSceneAdapter(AUSchema schema) { (this.schema = schema).NullCheck("schmea"); }
private void InitizeTree(string fromUnitID, AUSchema schema) { tree.Nodes.Clear(); var root = AddSchemaToTree(schema, tree.Nodes); var subUnits = AU.Adapters.AUSnapshotAdapter.Instance.LoadSubUnits(this.hfSchemaID.Value, this.hfSchemaID.Value, true, DateTime.MinValue); foreach (AU.AdminUnit item in subUnits) { AddUnitToTree(item, root.Nodes); } }
private static bool CheckAddSubPermission(AUSchema schema, AdminUnit targetUnit) { bool result = false; result = AU.AUPermissionHelper.IsSupervisor(DeluxePrincipal.Current); if (result == false) { if (string.IsNullOrEmpty(schema.MasterRole) == false) { result = DeluxePrincipal.Current.IsInRole(schema.MasterRole); if (result == false && targetUnit != null) { var permissions = AU.Adapters.AUAclAdapter.Instance.LoadCurrentContainerAndPermissions(DeluxeIdentity.CurrentUser.ID, new string[] { targetUnit.ID }); result = Util.ContainsPermission(permissions, targetUnit.ID, "AddSubUnit"); } } } return result; }
private static void ValidateName(string name, string codeName, ValidationResult result, AUSchema schema, SchemaObjectBase targetUnit) { var actualParent = (SchemaObjectBase)targetUnit ?? schema; var adminUnit = new AdminUnit() { ID = UuidHelper.NewUuidString(), CodeName = codeName, Name = name, AUSchemaID = schema.ID }; var validationObjResult = adminUnit.Validate(); result.ObjectValidationResult = validationObjResult.ResultCount > 0 ? ToMessage(validationObjResult.First()) : "通过"; result.Passed &= validationObjResult.ResultCount == 0; if (result.Passed) { SCRelationObject relation = new SCRelationObject(actualParent, adminUnit); var existedObj = AU.Adapters.AUSnapshotAdapter.Instance.LoadAUByChildName(name, actualParent.ID, AUCommon.SchemaAdminUnit, true, DateTime.MinValue); result.NameValidationResult = existedObj.Count > 0 ? "此名称已经被占用,请使用其他名称" : "通过"; result.Passed &= existedObj.Count == 0; } }
private void DeterminPermission(AUSchema schema, AdminUnit unit) { bool editEnabled = TimePointContext.Current.UseCurrentTime; if (editEnabled) { if (Util.SuperVisiorMode == false) { if (string.IsNullOrEmpty(schema.MasterRole) == false) { editEnabled = DeluxePrincipal.Current.IsInRole(schema.MasterRole); if (editEnabled == false) { var permissions = AU.Adapters.AUAclAdapter.Instance.LoadCurrentContainerAndPermissions(DeluxeIdentity.CurrentUser.ID, new string[] { unit.ID }); editEnabled = Util.ContainsPermission(permissions, unit.ID, "EditAdminScope"); ; } } } } this.EditEnabled = editEnabled; }