更改权限
This commit is contained in:
@@ -6,6 +6,8 @@ using Microsoft.AspNetCore.Http;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using IRaCIS.Core.Application.Auth;
|
||||
|
||||
namespace IRaCIS.Core.Application
|
||||
{
|
||||
@@ -68,6 +70,7 @@ namespace IRaCIS.Core.Application
|
||||
/// 签名确认 包括项目的三组配置 + QC问题确认 后修改状态 (适用于不会回退的,项目废除、状态修改, 存在回退 不在这里弄,提供单独接口修改状态)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM)]
|
||||
public async Task<IResponseOutput> TrialConfigSignatureConfirm(SignConfirmDTO signConfirmDTO)
|
||||
{
|
||||
await VerifyOnlyInOngoingOrInitialIzingOptAsync(signConfirmDTO.TrialId);
|
||||
@@ -144,6 +147,7 @@ namespace IRaCIS.Core.Application
|
||||
/// <param name="trialConfig"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM)]
|
||||
public async Task<IResponseOutput> ConfigTrialBasicInfo(BasicTrialConfig trialConfig)
|
||||
{
|
||||
await VerifyOnlyInOngoingOrInitialIzingOptAsync(trialConfig.TrialId);
|
||||
@@ -175,6 +179,7 @@ namespace IRaCIS.Core.Application
|
||||
/// <returns></returns>
|
||||
[HttpPut("{trialId:guid}/{trialStatusStr}/{reason?}")]
|
||||
[UnitOfWork]
|
||||
[Authorize(Policy = IRaCISPolicy.PM)]
|
||||
public async Task<IResponseOutput> UpdateTrialState(Guid trialId, string trialStatusStr, string? reason)
|
||||
{
|
||||
|
||||
@@ -250,6 +255,7 @@ namespace IRaCIS.Core.Application
|
||||
/// <param name="isAbandon"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("{trialId:guid}/{isAbandon:bool}")]
|
||||
[Authorize(Policy = IRaCISPolicy.PM)]
|
||||
public async Task<IResponseOutput> AbandonTrial(Guid trialId, /*Guid? signId,*/ bool isAbandon)
|
||||
{
|
||||
|
||||
@@ -287,6 +293,7 @@ namespace IRaCIS.Core.Application
|
||||
/// <param name="trialConfig"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM)]
|
||||
public async Task<IResponseOutput> ConfigTrialProcessInfo(TrialProcessConfig trialConfig)
|
||||
{
|
||||
if (!await _trialRepository.Where(t => t.Id == trialConfig.TrialId).IgnoreQueryFilters().AnyAsync(t => t.TrialStatusStr == StaticData.TrialInitializing))
|
||||
@@ -311,6 +318,7 @@ namespace IRaCIS.Core.Application
|
||||
/// <param name="trialConfig"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM)]
|
||||
public async Task<IResponseOutput> ConfigTrialUrgentInfo(TrialUrgentConfig trialConfig)
|
||||
{
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// </summary>
|
||||
/// <param name="addOrEditTrialExternalUser"></param>
|
||||
/// <returns></returns>
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM)]
|
||||
public async Task<IResponseOutput> AddOrUpdateTrialExternalUser(TrialExternalUserAddAndSendEmail addOrEditTrialExternalUser)
|
||||
{
|
||||
|
||||
@@ -197,6 +198,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
|
||||
[HttpDelete("{trialExternalUserId:guid}/{isSystemUser:bool}/{systemUserId}")]
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM)]
|
||||
public async Task<IResponseOutput> DeleteTrialExternalUser(Guid trialExternalUserId, bool isSystemUser, Guid systemUserId)
|
||||
{
|
||||
var success = await _trialExternalUseRepository.BatchDeleteNoTrackingAsync(t => t.Id == trialExternalUserId);
|
||||
@@ -212,6 +214,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
//New 省掉邀请流程
|
||||
[HttpPost]
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM)]
|
||||
public async Task<IResponseOutput> SendExternalUserJoinEmail(TrialExternalUserSendEmail sendEmail)
|
||||
{
|
||||
var trialInfo = (await _repository.FirstOrDefaultAsync<Trial>(t => t.Id == sendEmail.TrialId)).IfNullThrowException();
|
||||
|
||||
@@ -7,6 +7,7 @@ using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.Service;
|
||||
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using IRaCIS.Core.Application.Auth;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
@@ -129,6 +130,7 @@ namespace IRaCIS.Application.Services
|
||||
//[TrialAudit(AuditType.TrialAudit, AuditOptType.AddTrialStaff)]
|
||||
[HttpPost]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM)]
|
||||
public async Task<IResponseOutput> AddTrialUsers(TrialUserAddCommand[] userTrialCommands)
|
||||
{
|
||||
|
||||
@@ -150,6 +152,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM)]
|
||||
[HttpPut]
|
||||
public async Task<IResponseOutput> UpdateTrialUser(UpdateTrialUserCommand updateTrialUserCommand)
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.Service;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using IRaCIS.Core.Application.Auth;
|
||||
|
||||
namespace IRaCIS.Core.Application.Services
|
||||
{
|
||||
@@ -210,7 +211,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
/// <summary>Setting页面 Site批量添加</summary>
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
[TrialAudit(AuditType.TrialAudit, AuditOptType.AddTrialSite)]
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM)]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
public async Task<IResponseOutput> AddTrialSites(List<TrialSiteCommand> trialSites)
|
||||
{
|
||||
@@ -224,13 +225,13 @@ namespace IRaCIS.Core.Application.Services
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 项目site 编辑接口 New 可以设置为启用不启用 不启用 不会验证Code 重复
|
||||
/// </summary>
|
||||
/// <param name="editTrialSiteCommand"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM)]
|
||||
public async Task<IResponseOutput> EditTrialSite(EditTrialSiteCommand editTrialSiteCommand)
|
||||
{
|
||||
|
||||
@@ -282,8 +283,8 @@ namespace IRaCIS.Core.Application.Services
|
||||
|
||||
/// <summary> 批量添加Site下 CRC的负责人 </summary>
|
||||
[HttpPost]
|
||||
[TrialAudit(AuditType.TrialAudit, AuditOptType.AddTrialSiteCRC)]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM)]
|
||||
public async Task<IResponseOutput> AssignSiteCRC(List<AssginSiteCRCCommand> trialSiteCRCList)
|
||||
{
|
||||
var addArray = _mapper.Map<List<TrialSiteUser>>(trialSiteCRCList);
|
||||
@@ -297,6 +298,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
/// <summary> 删除CRC人员</summary>
|
||||
[HttpDelete, Route("{id:guid}/{trialId:guid}/{isDelete:bool}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
[Authorize(Policy = IRaCISPolicy.PMAndAPM)]
|
||||
public async Task<IResponseOutput> DeleteSiteCRC(Guid id, bool isDelete)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user