public RemoveNodeOntologyCatalogCommand(IAcSession acSession, Guid nodeId, Guid ontologyId, Guid catalogId) { this.AcSession = acSession; this.NodeId = nodeId; this.OntologyId = ontologyId; this.CatalogId = catalogId; }
public SaveHelpCommand(IAcSession acSession, Guid functionId, string content, int? isEnabled) { this.AcSession = acSession; this.FunctionId = functionId; this.Content = content; this.IsEnabled = isEnabled; }
public bool Permit(IAcSession user, FunctionState function, IManagedObject data) { if (function == null) { throw new ArgumentNullException("function"); } // 如果非托管 if (!function.IsManaged) { return true; } if (!user.Identity.IsAuthenticated) { return false; } if (user.IsDeveloper()) { return true; } var functionIDs = user.AccountPrivilege.AuthorizedFunctionIDs; if (!functionIDs.Contains(function.Id)) { return false; } if (data != null) { // TODO:验证实体级权限。anycmd 1.0版本暂不支持,后续版本支持 } return true; }
protected ActionResult HandleSeparateGuidString(Action<IAcSession, Guid> action, IAcSession acSession, string id, params char[] separator) { if (action == null) { throw new ArgumentNullException("action"); } if (id == null) { throw new ArgumentNullException("id"); } string[] ids = id.Split(separator); var idArray = new Guid[ids.Length]; for (int i = 0; i < ids.Length; i++) { Guid tmp; if (Guid.TryParse(ids[i], out tmp)) { idArray[i] = tmp; } else { throw new ValidationException("意外的Guid格式" + ids[i]); } } foreach (var item in idArray) { action(acSession, item); } return this.JsonResult(new ResponseData { id = id, success = true }); }
public OntologyUpdatedEvent(IAcSession acSession, OntologyBase source, IOntologyUpdateIo output) : base(acSession, source) { if (output == null) { throw new System.ArgumentNullException("output"); } this.Output = output; }
public CatalogRemovedEvent(IAcSession acSession, CatalogBase source) : base(acSession, source) { if (source == null) { throw new ArgumentException("source"); } this.CatalogCode = source.Code; }
public ArchiveUpdatedEvent(IAcSession acSession, ArchiveBase source) : base(acSession, source) { this.DataSource = source.DataSource; this.FilePath = source.FilePath; this.NumberId = source.NumberId; this.UserId = source.UserId; this.Password = source.Password; }
public UpdateDbViewColumnCommand(IAcSession acSession, IDbViewColumnUpdateInput input) { if (input == null) { throw new ArgumentNullException("input"); } this.AcSession = acSession; this.Input = input; }
public InfoDicItemUpdatedEvent(IAcSession acSession, InfoDicItemBase source, IInfoDicItemUpdateIo output) : base(acSession, source) { if (output == null) { throw new System.ArgumentNullException("output"); } this.Output = output; }
public MenuUpdatedEvent(IAcSession acSession, MenuBase source, IMenuUpdateIo input) : base(acSession, source) { if (input == null) { throw new System.ArgumentNullException("input"); } this.Input = input; }
public AppSystemAddedEvent(IAcSession acSession, AppSystemBase source, IAppSystemCreateIo input) : base(acSession, source) { if (input == null) { throw new ArgumentNullException("input"); } this.Input = input; }
public AssignPasswordCommand(IAcSession acSession, IPasswordAssignIo input) { if (input == null) { throw new ArgumentNullException("input"); } this.AcSession = acSession; this.Input = input; }
public RoleUpdatedEvent(IAcSession acSession, RoleBase source, IRoleUpdateIo output) : base(acSession, source) { if (output == null) { throw new ArgumentNullException("output"); } this.Output = output; }
public NodeElementCareAddedEvent(IAcSession acSession, NodeElementCareBase source, INodeElementCareCreateIo output) : base(acSession, source) { if (output == null) { throw new System.ArgumentNullException("output"); } this.Output = output; }
public UiViewButtonUpdatedEvent(IAcSession acSession, UiViewButtonBase source, IUiViewButtonUpdateIo input) : base(acSession, source) { if (input == null) { throw new System.ArgumentNullException("input"); } this.Input = input; }
public NodeOntologyCatalogAddedEvent(IAcSession acSession, NodeOntologyCatalogBase source, INodeOntologyCatalogCreateIo output) : base(acSession, source) { if (output == null) { throw new System.ArgumentNullException("output"); } this.Output = output; }
public PrivilegeAddedEvent(IAcSession acSession, PrivilegeBase source, IPrivilegeCreateIo output) : base(acSession, source) { if (output == null) { throw new System.ArgumentNullException("output"); } this.Output = output; }
/// <summary> /// /// </summary> public ActionUpdatedEvent(IAcSession acSession, ActionBase source) : base(acSession, source) { this.Verb = source.Verb; this.Name = source.Name; this.IsAllowed = source.IsAllowed; this.IsAudit = source.IsAudit; this.IsPersist = source.IsPersist; this.SortCode = source.SortCode; }
public void AddActiveRole(IAcSession subject, IAcSession targetSession, Guid roleId) { RoleState role; if (!_acDomain.RoleSet.TryGetRole(roleId, out role)) { throw new ValidationException("给定标识的角色不存在" + roleId); } IAcSession session = targetSession; if (session == null) { throw new ValidationException("给定标识的会话不存在"); } session.AccountPrivilege.AddActiveRole(role); }
public void AddDescendant(IAcSession subject, Guid parentRoleId, IRoleCreateIo childRoleCreateInput) { _acDomain.Handle(new AddRoleCommand(subject, childRoleCreateInput)); Debug.Assert(childRoleCreateInput.Id != null, "childRoleCreateInput.Id != null"); _acDomain.Handle(new AddPrivilegeCommand(subject, new PrivilegeCreateIo { Id = Guid.NewGuid(), SubjectType = UserAcSubjectType.Role.ToName(), SubjectInstanceId = childRoleCreateInput.Id.Value, ObjectType = AcElementType.Role.ToName(), ObjectInstanceId = parentRoleId, AcContent = null, AcContentType = null })); }
public AddProcessCommand(IAcSession acSession, IProcessCreateIo input) : base(acSession, input) { }
internal DeveloperRemovedEvent(IAcSession acSession, DeveloperId source, bool isPrivate) : this(acSession, source) { this.IsPrivate = isPrivate; }
public DeveloperRemovedEvent(IAcSession acSession, DeveloperId source) : base(acSession, source) { }
public RoleRolePrivilegeRemovedEvent(IAcSession acSession, PrivilegeBase source) : base(acSession, source) { }
public UpdateDsdSetCommand(IAcSession acSession, IDsdSetUpdateIo input) : base(acSession, input) { }
public override IAnycmdCommand ToCommand(IAcSession acSession) { return(new AddCatalogCommand(acSession, this)); }
private void Handle(IAcSession acSession, IMenuCreateIo input, bool isCommand) { var acDomain = _set._acDomain; var menuById = _set._menuById; var menuRepository = acDomain.RetrieveRequiredService <IRepository <Menu> >(); if (!input.Id.HasValue) { throw new ValidationException("标识是必须的"); } MenuState menu; if (acDomain.MenuSet.TryGetMenu(input.Id.Value, out menu)) { throw new ValidationException("给定标识的实体已经存在" + input.Id); } if (input.ParentId.HasValue) { MenuState parentMenu; if (!acDomain.MenuSet.TryGetMenu(input.ParentId.Value, out parentMenu)) { throw new NotExistException("标识为" + input.ParentId.Value + "的父菜单不存在"); } if (input.AppSystemId != parentMenu.AppSystemId) { throw new ValidationException("非法的数据,子菜单的应用系统必须和父菜单一致"); } } var entity = Menu.Create(input); lock (Locker) { if (acDomain.MenuSet.TryGetMenu(input.Id.Value, out menu)) { throw new ValidationException("给定标识的实体已经存在" + input.Id); } if (input.ParentId.HasValue) { MenuState parentMenu; if (!acDomain.MenuSet.TryGetMenu(input.ParentId.Value, out parentMenu)) { throw new NotExistException("标识为" + input.ParentId.Value + "的父菜单不存在"); } } var menuState = MenuState.Create(acDomain, entity); if (!menuById.ContainsKey(entity.Id)) { menuById.Add(entity.Id, menuState); } if (isCommand) { try { menuRepository.Add(entity); menuRepository.Context.Commit(); } catch { if (menuById.ContainsKey(entity.Id)) { menuById.Remove(entity.Id); } menuRepository.Context.Rollback(); throw; } } } if (isCommand) { acDomain.MessageDispatcher.DispatchMessage(new MenuAddedEvent(acSession, entity, input, isPrivate: true)); } }
public override IAnycmdCommand ToCommand(IAcSession acSession) { return new AddRoleCommand(acSession, this); }
internal PrivilegeRemovedEvent(IAcSession acSession, PrivilegeBase source, bool isPrivate) : this(acSession, source) { this.IsPrivate = isPrivate; }
public BatchRemovedEvent(IAcSession acSession, IBatch source) : base(acSession, source) { }
public AddPrivilegeCommand(IAcSession acSession, IPrivilegeCreateIo input) : base(acSession, input) { }
public RemovePrivilegeCommand(IAcSession acSession, Guid privilegeBigramId) : base(acSession, privilegeBigramId) { }
public UpdatePrivilegeCommand(IAcSession acSession, IPrivilegeUpdateIo input) : base(acSession, input) { }
internal UiViewUpdatedEvent(IAcSession acSession, UiViewBase source, IUiViewUpdateIo input, bool isPrivate) : this(acSession, source, input) { this.IsPrivate = isPrivate; }
public AddDsdRoleCommand(IAcSession acSession, IDsdRoleCreateIo input) : base(acSession, input) { }
public AddActionCommand(IAcSession acSession, IActionCreateIo input) : base(acSession, input) { }
public override IAnycmdCommand ToCommand(IAcSession acSession) { return(new AddAppSystemCommand(acSession, this)); }
public AppSystemRemovedEvent(IAcSession acSession, AppSystemBase source) : base(acSession, source) { }
public ButtonRemovedEvent(IAcSession acSession, ButtonBase source) : base(acSession, source) { }
public IAnycmdCommand ToCommand(IAcSession acSession) { return(new UpdateAccountCommand(acSession, this)); }
public IAnycmdCommand ToCommand(IAcSession acSession) { return(new UpdateUiViewButtonCommand(acSession, this)); }
internal PrivilegeUpdatedEvent(IAcSession acSession, PrivilegeBase source, IPrivilegeUpdateIo input, bool isPrivate) : this(acSession, source, input) { this.IsPrivate = isPrivate; }
public RemoveGroupCommand(IAcSession acSession, Guid groupId) : base(acSession, groupId) { }
internal InfoDicItemAddedEvent(IAcSession acSession, InfoDicItemBase source, IInfoDicItemCreateIo input, bool isPrivate) : this(acSession, source, input) { this.IsPrivate = isPrivate; }
public AccountAddedEvent(IAcSession acSession, AccountBase source) : base(acSession, source) { }
public RemoveArchiveCommand(IAcSession acSession, Guid archiveId) : base(acSession, archiveId) { }
public ElementRemovedEvent(IAcSession acSession, ElementBase source) : base(acSession, source) { }
public RemoveBatchCommand(IAcSession acSession, Guid batchId) : base(acSession, batchId) { }
public CatalogActionAddedEvent(IAcSession acSession, CatalogAction source) : base(acSession, source) { }
public UpdateStateCodeCommand(IAcSession acSession, IStateCodeUpdateInput input) : base(acSession, input) { }
public IAnycmdCommand ToCommand(IAcSession acSession) { return new UpdateInfoRuleCommand(acSession, this); }
internal NodeUpdatedEvent(IAcSession acSession, NodeBase source, INodeUpdateIo input, bool isPrivate) : this(acSession, source, input) { this.IsPrivate = isPrivate; }
public NodeActionRemovedEvent(IAcSession acSession, NodeAction source) : base(acSession, source) { }
public AddBatchCommand(IAcSession acSession, IBatchCreateIo input) : base(acSession, input) { }
internal InfoDicItemUpdatedEvent(IAcSession acSession, InfoDicItemBase source, IInfoDicItemUpdateIo input, bool isPrivate) : this(acSession, source, input) { this.IsPrivate = isPrivate; }
public UpdateInfoDicItemCommand(IAcSession acSession, IInfoDicItemUpdateIo input) : base(acSession, input) { }
internal AppSystemRemovedEvent(IAcSession acSession, AppSystemBase source, bool isPrivate) : this(acSession, source) { this.IsPrivate = isPrivate; }
internal OntologyCatalogAddedEvent(IAcSession acSession, OntologyCatalogBase source, IOntologyCatalogCreateIo input, bool isPrivate) : this(acSession, source, input) { this.IsPrivate = isPrivate; }
internal ButtonRemovedEvent(IAcSession acSession, ButtonBase source, bool isPrivate) : this(acSession, source) { this.IsPrivate = isPrivate; }
public IAnycmdCommand ToCommand(IAcSession acSession) { return(new UpdateDbViewColumnCommand(acSession, this)); }