aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-02-13 16:01:20 +0800
committerGitHub <noreply@github.com>2021-02-13 16:01:20 +0800
commit6a1495dc98f5ae5f89de58ed0ff0b500fc71ff5a (patch)
tree60cc46ed16a3d84b654cce4b3f364f5eccce52b0 /BackEnd/Timeline/Controllers/BookmarkTimelineController.cs
parentc3d0a5f88de0fbdf6bc584548832017087ab1248 (diff)
parentfd5f842e807ecf0d3a4c385fd0e5e3a52b0a79b2 (diff)
downloadtimeline-6a1495dc98f5ae5f89de58ed0ff0b500fc71ff5a.tar.gz
timeline-6a1495dc98f5ae5f89de58ed0ff0b500fc71ff5a.tar.bz2
timeline-6a1495dc98f5ae5f89de58ed0ff0b500fc71ff5a.zip
Merge pull request #273 from crupest/backend
User permission related field in http.
Diffstat (limited to 'BackEnd/Timeline/Controllers/BookmarkTimelineController.cs')
-rw-r--r--BackEnd/Timeline/Controllers/BookmarkTimelineController.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs b/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs
index 16793de6..e2a08dcb 100644
--- a/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs
+++ b/BackEnd/Timeline/Controllers/BookmarkTimelineController.cs
@@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading.Tasks;
+using Timeline.Entities;
using Timeline.Models.Http;
using Timeline.Models.Mapper;
using Timeline.Models.Validation;
@@ -28,6 +29,11 @@ namespace Timeline.Controllers
_timelineMapper = timelineMapper;
}
+ private Task<List<HttpTimeline>> Map(List<TimelineEntity> timelines)
+ {
+ return _timelineMapper.MapToHttp(timelines, Url, this.GetOptionalUserId(), this.UserHasPermission(UserPermission.AllTimelineManagement));
+ }
+
/// <summary>
/// Get bookmark list in order.
/// </summary>
@@ -40,7 +46,7 @@ namespace Timeline.Controllers
{
var ids = await _service.GetBookmarks(this.GetUserId());
var timelines = await _timelineService.GetTimelineList(ids);
- return await _timelineMapper.MapToHttp(timelines, Url, this.GetOptionalUserId());
+ return await Map(timelines);
}
/// <summary>