From 6a67bce1014f855ec434bd58236faf9ff302837f Mon Sep 17 00:00:00 2001 From: enisn Date: Tue, 9 Mar 2021 13:25:50 +0300 Subject: [PATCH] CmsKit - Convert BusinessExceptions to AbpAuthorizationException --- .../Volo/CmsKit/Public/Comments/CommentPublicAppService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Comments/CommentPublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Comments/CommentPublicAppService.cs index d5dd555b71..f716660d23 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Comments/CommentPublicAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Comments/CommentPublicAppService.cs @@ -7,6 +7,7 @@ using Microsoft.Extensions.Options; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; +using Volo.Abp.Authorization; using Volo.Abp.EventBus.Distributed; using Volo.Abp.Uow; using Volo.Abp.Users; @@ -85,7 +86,7 @@ namespace Volo.CmsKit.Public.Comments if (comment.CreatorId != CurrentUser.GetId()) { - throw new BusinessException(); //TODO: AbpAuthorizationException! + throw new AbpAuthorizationException(); } comment.SetText(input.Text); @@ -102,7 +103,7 @@ namespace Volo.CmsKit.Public.Comments if (comment.CreatorId != CurrentUser.GetId()) { - throw new BusinessException(); //TODO: AbpAuthorizationException! + throw new AbpAuthorizationException(); } await CommentRepository.DeleteWithRepliesAsync(comment);