예제 #1
0
        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));
        }
예제 #2
0
        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));
        }