aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Controllers/TimelinePostController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-04-30 17:53:40 +0800
committercrupest <crupest@outlook.com>2021-04-30 17:53:40 +0800
commite536121d97610af09d6bf4a51a875b0f7d50f702 (patch)
tree4f6e2f0ddae0920cc1ef3213dc36953a95bb2fc8 /BackEnd/Timeline/Controllers/TimelinePostController.cs
parent9f81ec1d4a54239ae9456923115f4a1e379d9e71 (diff)
downloadtimeline-e536121d97610af09d6bf4a51a875b0f7d50f702.tar.gz
timeline-e536121d97610af09d6bf4a51a875b0f7d50f702.tar.bz2
timeline-e536121d97610af09d6bf4a51a875b0f7d50f702.zip
refactor: ...
Diffstat (limited to 'BackEnd/Timeline/Controllers/TimelinePostController.cs')
-rw-r--r--BackEnd/Timeline/Controllers/TimelinePostController.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/BackEnd/Timeline/Controllers/TimelinePostController.cs b/BackEnd/Timeline/Controllers/TimelinePostController.cs
index 70f672d1..21102400 100644
--- a/BackEnd/Timeline/Controllers/TimelinePostController.cs
+++ b/BackEnd/Timeline/Controllers/TimelinePostController.cs
@@ -69,7 +69,7 @@ namespace Timeline.Controllers
if (!UserHasAllTimelineManagementPermission && !await _timelineService.HasReadPermissionAsync(timelineId, this.GetOptionalUserId()))
{
- return StatusCode(StatusCodes.Status403Forbidden, ErrorResponse.Common.Forbid());
+ return this.ForbidWithMessage();
}
var posts = await _postService.GetPostsAsync(timelineId, modifiedSince, includeDeleted ?? false);
@@ -94,7 +94,7 @@ namespace Timeline.Controllers
if (!UserHasAllTimelineManagementPermission && !await _timelineService.HasReadPermissionAsync(timelineId, this.GetOptionalUserId()))
{
- return StatusCode(StatusCodes.Status403Forbidden, ErrorResponse.Common.Forbid());
+ return this.ForbidWithMessage();
}
var post = await _postService.GetPostAsync(timelineId, postId);
@@ -140,7 +140,7 @@ namespace Timeline.Controllers
if (!UserHasAllTimelineManagementPermission && !await _timelineService.HasReadPermissionAsync(timelineId, this.GetOptionalUserId()))
{
- return StatusCode(StatusCodes.Status403Forbidden, ErrorResponse.Common.Forbid());
+ return this.ForbidWithMessage();
}
return await DataCacheHelper.GenerateActionResult(this,
@@ -176,7 +176,7 @@ namespace Timeline.Controllers
if (!UserHasAllTimelineManagementPermission && !await _timelineService.IsMemberOfAsync(timelineId, userId))
{
- return StatusCode(StatusCodes.Status403Forbidden, ErrorResponse.Common.Forbid());
+ return this.ForbidWithMessage();
}
var createRequest = new TimelinePostCreateRequest()
@@ -235,7 +235,7 @@ namespace Timeline.Controllers
if (!UserHasAllTimelineManagementPermission && !await _postService.HasPostModifyPermissionAsync(timelineId, post, this.GetUserId(), true))
{
- return StatusCode(StatusCodes.Status403Forbidden, ErrorResponse.Common.Forbid());
+ return this.ForbidWithMessage();
}
var entity = await _postService.PatchPostAsync(timelineId, post, new TimelinePostPatchRequest { Time = body.Time, Color = body.Color });
@@ -262,7 +262,7 @@ namespace Timeline.Controllers
if (!UserHasAllTimelineManagementPermission && !await _postService.HasPostModifyPermissionAsync(timelineId, post, this.GetUserId(), true))
{
- return StatusCode(StatusCodes.Status403Forbidden, ErrorResponse.Common.Forbid());
+ return this.ForbidWithMessage();
}
await _postService.DeletePostAsync(timelineId, post);