public async Task <Trigger> AddAsync(Trigger trigger) { VerifyManagementPermission(); trigger.SiteId = GetCurrentSiteId(); trigger.RelatedBranchId = GetClaimId(ClaimType.BranchId); trigger.RelatedSystemId = GetClaimId(ClaimType.SystemId); await ValidateTriggerAsync(trigger); return(await _triggerRepository.AddSaveAsync(GetClaimId(ClaimType.UserId), trigger)); }
public async Task <Trigger> AddAsync(Trigger trigger) { VerifyManagementPermission(); trigger.SiteId = GetCurrentSiteId(); trigger.RelatedBranchId = GetClaimId(ClaimType.BranchId); trigger.RelatedSystemId = GetClaimId(ClaimType.SystemId); if (!HasPermission(Permission.ManageVendorCodes)) { trigger.AwardVendorCodeTypeId = null; } if (!HasPermission(Permission.MailParticipants)) { trigger.AwardMail = null; trigger.AwardMailSubject = null; } await ValidateTriggerAsync(trigger); return(await _triggerRepository.AddSaveAsync(GetClaimId(ClaimType.UserId), trigger)); }