更改权限
This commit is contained in:
@@ -21,6 +21,7 @@ using IRaCIS.Core.Infrastructure;
|
||||
using IRaCIS.Core.Application.Service.Inspection.DTO;
|
||||
using Nito.AsyncEx;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using IRaCIS.Core.Application.Auth;
|
||||
|
||||
namespace IRaCIS.Core.Application.Image.QA
|
||||
{
|
||||
@@ -68,6 +69,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
[HttpGet("{trialId:guid}/{subjectVisitId:guid}/{currentQCType:int}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||
public async Task<IResponseOutput> VerifyQCCanAddChallenge(Guid subjectVisitId, [FromRoute] CurrentQC currentQCType)
|
||||
{
|
||||
await VerifyIsCanQCAsync(null, subjectVisitId);
|
||||
@@ -90,7 +92,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <returns></returns>
|
||||
[HttpPost("{trialId:guid}/{trialQCProcess:int}/{currentQCType:int}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = "ImageQCPolicy")]
|
||||
[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||
public async Task<IResponseOutput> AddOrUpdateQCChallenge(QCChallengeCommand qaQuestionCommand, Guid trialId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType)
|
||||
{
|
||||
await VerifyIsCanQCAsync(null, qaQuestionCommand.SubjectVisitId);
|
||||
@@ -147,7 +149,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
[HttpPut]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[UnitOfWork]
|
||||
//[Authorize(Policy = "ImageQCPolicy")]
|
||||
[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||
public async Task<IResponseOutput> CloseQCChallenge(CloseQCChallengeInDto input)
|
||||
{
|
||||
|
||||
@@ -199,7 +201,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{trialId:guid}/{subjectVisitId:guid}/{qcChallengeId:guid}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = "ImageQCPolicy")]
|
||||
[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||
public async Task<IResponseOutput> DeleteQCChallenge(Guid qcChallengeId)
|
||||
{
|
||||
|
||||
@@ -226,7 +228,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <returns></returns>
|
||||
[HttpPost("{trialId:guid}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = "ImageQCPolicy")]
|
||||
[Authorize(Policy = IRaCISPolicy.CRC_IQC)]
|
||||
public async Task<IResponseOutput> AddQCChallengeReply(QADialogCommand qaDialogCommand)
|
||||
{
|
||||
var qaReply = _mapper.Map<QCChallengeDialog>(qaDialogCommand);
|
||||
@@ -261,7 +263,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <returns></returns>
|
||||
[HttpPost("{trialId:guid}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = "ImageCheckPolicy")]
|
||||
[Authorize(Policy = IRaCISPolicy.PM_APM_CRC)]
|
||||
public async Task<IResponseOutput> AddCheckChallengeReply(CheckChallengeDialogCommand checkDialogCommand)
|
||||
{
|
||||
|
||||
@@ -300,6 +302,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <returns></returns>
|
||||
[HttpPut("{trialId:guid}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM)]
|
||||
public async Task<IResponseOutput> CloseCheckChallenge(CloseCheckChallengeDto input)
|
||||
{
|
||||
|
||||
@@ -333,7 +336,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <returns></returns>
|
||||
[HttpPut("{trialId:guid}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = "PmAndApmPolicy")]
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM )]
|
||||
public async Task<IResponseOutput> SetCheckPass(SetCheckPassDt data)
|
||||
{
|
||||
//if (_userInfo.UserTypeEnumInt != (int)UserTypeEnum.ProjectManager && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.APM)
|
||||
@@ -374,6 +377,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <returns></returns>
|
||||
[HttpPut("{trialId:guid}/{subjectVisitId:guid}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = IRaCISPolicy.CRC)]
|
||||
public async Task<IResponseOutput> CRCRequstCheckBack(Guid subjectVisitId)
|
||||
{
|
||||
var sv = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException();
|
||||
@@ -412,7 +416,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
}
|
||||
|
||||
[HttpPut("{trialId:guid}/{subjectVisitId:guid}")]
|
||||
[Authorize(Policy = "PmAndApmPolicy")]
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM)]
|
||||
public async Task<IResponseOutput> RejectCheckBack(Guid subjectVisitId)
|
||||
{
|
||||
//if (_userInfo.UserTypeEnumInt != (int)UserTypeEnum.ProjectManager && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.APM)
|
||||
@@ -444,7 +448,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <returns></returns>
|
||||
[HttpPut("{trialId:guid}/{subjectVisitId:guid}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = "PmAndApmPolicy")]
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM)]
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> CheckBack(Guid subjectVisitId)
|
||||
{
|
||||
@@ -518,7 +522,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <returns></returns>
|
||||
[HttpPost("{trialId:guid}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = "PmAndApmPolicy")]
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM)]
|
||||
public async Task<IResponseOutput> UploadVisitCheckExcel(IFormFile file, Guid trialId)
|
||||
{
|
||||
//if (_userInfo.UserTypeEnumInt != (int)UserTypeEnum.ProjectManager && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.APM)
|
||||
@@ -715,6 +719,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// </summary>
|
||||
[HttpPost("{trialId:guid}/{subjectVisitId:guid}/{trialQCProcess:int}/{currentQCType:int}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||
public async Task<IResponseOutput> AddOrUpdateQCQuestionAnswerList(QCQuestionAnswerCommand[] qcQuestionAnswerCommands, Guid trialId, Guid subjectVisitId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType)
|
||||
{
|
||||
//验证是否能操作
|
||||
@@ -785,6 +790,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <returns></returns>
|
||||
[HttpPut("{trialId:guid}/{subjectVisitId:guid}/{studyId:guid}/{seriesId:guid}/{state:int}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||
public async Task<IResponseOutput> SetSeriesState(Guid subjectVisitId, Guid studyId, Guid seriesId, int state)
|
||||
{
|
||||
|
||||
@@ -852,6 +858,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <returns></returns>
|
||||
[HttpPost("{trialId:guid}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||
public async Task<IResponseOutput> UpdateModality(UpdateModalityCommand updateModalityCommand)
|
||||
{
|
||||
|
||||
@@ -918,6 +925,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
[HttpPost, Route("{trialId:guid}/{subjectVisitId:guid}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[UnitOfWork]
|
||||
[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||
public async Task<IResponseOutput> DeleteStudyList(Guid[] ids, Guid subjectVisitId, Guid trialId)
|
||||
{
|
||||
|
||||
@@ -1013,6 +1021,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
/// <summary>替换当前领取人 </summary>
|
||||
[HttpPut("{trialId:guid}/{subjectVisitId:guid}")]
|
||||
[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||
public async Task<IResponseOutput> ReplaceQCTaskActionUser(Guid trialId, Guid subjectVisitId)
|
||||
{
|
||||
var dbSubjectVisit = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException();
|
||||
@@ -1045,6 +1054,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <returns></returns>
|
||||
[HttpPut("{trialId:guid}/{subjectVisitId:guid}/{obtaionOrCancel:bool}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||
public async Task<IResponseOutput> ObtainOrCancelQCTask(Guid trialId, Guid subjectVisitId, bool obtaionOrCancel)
|
||||
{
|
||||
|
||||
@@ -1248,6 +1258,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = IRaCISPolicy.CRC)]
|
||||
public async Task<IResponseOutput> CRCRequestToQC(CRCRequestToQCCommand cRCRequestToQCCommand)
|
||||
{
|
||||
var trialConfig = (await _trialRepository
|
||||
@@ -1374,6 +1385,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <returns></returns>
|
||||
[HttpPost("{trialId:guid}/{subjectVisitId:guid}/{auditState:int}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||
public async Task<IResponseOutput> QCPassedOrFailed(Guid trialId, Guid subjectVisitId, [FromRoute] AuditStateEnum auditState)
|
||||
{
|
||||
|
||||
@@ -1556,6 +1568,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <returns></returns>
|
||||
[HttpPut("{trialId:guid}/{subjectVisitId:guid}/{setOrCancel:bool}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||
public async Task<IResponseOutput> SetVisitUrgent(Guid trialId, Guid subjectVisitId, bool setOrCancel)
|
||||
{
|
||||
var sv = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException();
|
||||
@@ -1592,13 +1605,9 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <returns></returns>
|
||||
[HttpPut("{trialId:guid}/{subjectVisitId:guid}/{qcChallengeId:guid}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||
public async Task<IResponseOutput> SetNeedReupload(Guid trialId, Guid qcChallengeId)
|
||||
{
|
||||
if (_userInfo.UserTypeEnumInt != (int)UserTypeEnum.IQC)
|
||||
{
|
||||
return ResponseOutput.NotOk("重传 只允许QA 设置!");
|
||||
}
|
||||
|
||||
|
||||
//获取项目配置
|
||||
var trialConfig = await _repository.Where<Trial>(t => t.Id == trialId).Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification })
|
||||
@@ -1693,14 +1702,10 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = IRaCISPolicy.CRC)]
|
||||
public async Task<IResponseOutput> SetReuploadFinished(CRCReuploadFinishedCommand cRCReuploadFinishedCommand)
|
||||
{
|
||||
if (_userInfo.UserTypeEnumInt != (int)UserTypeEnum.ClinicalResearchCoordinator)
|
||||
{
|
||||
throw new BusinessValidationFailedException("重传完成 只允许CRC 设置!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
var qcChallenge = (await _qcChallengeRepository.FirstOrDefaultAsync(t => t.Id == cRCReuploadFinishedCommand.QCChallengeId)).IfNullThrowException();
|
||||
|
||||
if (qcChallenge.ReuploadEnum != QCChanllengeReuploadEnum.QCAgreeUpload)
|
||||
@@ -1772,6 +1777,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
[HttpPut("{trialId:guid}/{subjectVisitId:guid}/{qcChallengeId:guid}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = IRaCISPolicy.CRC)]
|
||||
public async Task<IResponseOutput> CRCRequestReUpload(Guid qcChallengeId)
|
||||
{
|
||||
var qcChallenge = (await _qcChallengeRepository.FirstOrDefaultAsync(t => t.Id == qcChallengeId)).IfNullThrowException();
|
||||
@@ -1852,6 +1858,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
|
||||
[HttpPost("{trialId:guid}")]
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM)]
|
||||
public async Task<IResponseOutput> ForwardSVDicomImage(Guid[] subjectVisitIdList)
|
||||
{
|
||||
|
||||
|
||||
@@ -4,8 +4,10 @@
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
using IRaCIS.Core.Application.Auth;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
@@ -122,6 +124,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
/// <param name="trialId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("{trialId:guid}")]
|
||||
[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||
public async Task<IResponseOutput> BatchAddTrialQCQuestionConfigure(List<TrialQCQuestionConfigureBatchAdd> batchList, Guid trialId)
|
||||
{
|
||||
|
||||
@@ -137,7 +140,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
|
||||
|
||||
[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||
public async Task<IResponseOutput> AddOrUpdateTrialQCQuestionConfigure(TrialQCQuestionAddOrEdit addOrEditTrialQCQuestionConfigure)
|
||||
{
|
||||
await VerifyIsQCConfirmedAsync(addOrEditTrialQCQuestionConfigure.TrialId);
|
||||
@@ -149,6 +152,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
|
||||
[HttpDelete("{trialId:guid}/{trialQCQuestionConfigureId:guid}")]
|
||||
[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||
public async Task<IResponseOutput> DeleteTrialQCQuestionConfigure(Guid trialQCQuestionConfigureId, Guid trialId)
|
||||
{
|
||||
await VerifyIsQCConfirmedAsync(trialId);
|
||||
|
||||
Reference in New Issue
Block a user