public virtual PolicyStatement Build() { var props = new PolicyStatementProps { Effect = GrantEffect, Actions = (ActionList.Any() ? ActionList.ToArray() : null), Resources = (ResourceList.Any() ? ResourceList.ToArray() : new string[] { "*" }) }; return(new PolicyStatement(props)); }
public List <LogResult> GetLogChanges() { if (ActionList.NotNull() && !ActionList.Any()) { return(new List <LogResult>()); } var _lstLogResult = new List <LogResult>(); var attorneyId = AttorneyUser.UserId; if (_faxChanged) { var _logResult = new LogResult(); _logResult.UserId = attorneyId; _logResult.Type = LogType.Audit; _logResult.FieldName = nameof(CurrentFaxNumber); _logResult.PreviousValue = CurrentFaxNumber?.Number; _logResult.NewValue = NewFaxNumber?.Number; _logResult.Result = true; _logResult.Message = "Fax Changed"; _lstLogResult.Add(_logResult); } if (_assistantChanged) { var _logResult = new LogResult(); _logResult.UserId = attorneyId; _logResult.Type = LogType.Audit; _logResult.FieldName = nameof(CurrentAssistant); _logResult.PreviousValue = CurrentAssistant?.UserId; _logResult.NewValue = NewAssistant?.UserId; _logResult.Result = true; _logResult.Message = "Assistant Changed"; _lstLogResult.Add(_logResult); } foreach (var action in ActionList) { if (action.Result.NotNull()) { var _logResult = new LogResult(); _logResult.UserId = attorneyId; _logResult.Type = LogType.ApiCall; _logResult.Result = action.Result.Result; _logResult.FieldName = "FaxSoultion"; _logResult.NewValue = $"AttId:{action.AssistantSnycObj.FaxAttorneyUserId} UsrId:{action.AssistantSnycObj.FaxUserId} FaxId:{action.AssistantSnycObj.FaxNumberId}"; _logResult.Message = $"Action:{action.ActionType.ToString()} Message:{action.Result.HttpCallLog} {action.Result.Message}"; _lstLogResult.Add(_logResult); } } return(_lstLogResult); }