Browse Source

CmsKit - Convert BusinessExceptions to AbpAuthorizationException

pull/7955/head
enisn 5 years ago
parent
commit
6a67bce101
  1. 5
      modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Comments/CommentPublicAppService.cs

5
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);

Loading…
Cancel
Save