public void Handle(FunctionRemovingEvent message) { var acDomain = _set._acDomain; var viewDicById = _set._viewDicById; if (viewDicById.ContainsKey(message.Source.Id)) { acDomain.Handle(new RemoveUiViewCommand(message.AcSession, message.Source.Id)); } }
public void Handle(FunctionRemovingEvent message) { var acDomain = _set._acDomain; var privilegeList = _set._privilegeList; var accountPrivilegeRepository = acDomain.RetrieveRequiredService <IRepository <Privilege, Guid> >(); var accountPrivileges = accountPrivilegeRepository.AsQueryable().Where(a => a.ObjectInstanceId == message.Source.Id || a.SubjectInstanceId == message.Source.Id).ToList(); foreach (var item in accountPrivileges) { accountPrivilegeRepository.Remove(item); } foreach (var item in privilegeList.Where(a => a.ObjectType == AcElementType.Function && a.ObjectInstanceId == message.Source.Id)) { acDomain.Handle(new RemovePrivilegeCommand(message.AcSession, item.Id)); } }
public void Handle(FunctionRemovingEvent message) { var acDomain = _set._acDomain; var viewButtonDicById = _set._viewButtonDicById; var viewButtonIds = new HashSet <Guid>(); foreach (var item in viewButtonDicById.Values) { if (item.FunctionId.HasValue && item.FunctionId.Value == message.Source.Id) { viewButtonIds.Add(item.Id); } } foreach (var viewButtonId in viewButtonIds) { acDomain.Handle(new RemoveUiViewButtonCommand(message.AcSession, viewButtonId)); } }