diff options
author | crupest <crupest@outlook.com> | 2021-02-13 15:46:02 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-02-13 15:46:02 +0800 |
commit | 57b95cf3c53c0248355ffa46214224cdba4bf79b (patch) | |
tree | f3f399e819c5dcb6897aac67bde798eeabe4343e /BackEnd/Timeline/Controllers/HighlightTimelineController.cs | |
parent | d45f776470a7cece565a46655f286fcb06cb3a87 (diff) | |
download | timeline-57b95cf3c53c0248355ffa46214224cdba4bf79b.tar.gz timeline-57b95cf3c53c0248355ffa46214224cdba4bf79b.tar.bz2 timeline-57b95cf3c53c0248355ffa46214224cdba4bf79b.zip |
feat: Add timeline manageable.
Diffstat (limited to 'BackEnd/Timeline/Controllers/HighlightTimelineController.cs')
-rw-r--r-- | BackEnd/Timeline/Controllers/HighlightTimelineController.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/BackEnd/Timeline/Controllers/HighlightTimelineController.cs b/BackEnd/Timeline/Controllers/HighlightTimelineController.cs index ea012f76..f582e74b 100644 --- a/BackEnd/Timeline/Controllers/HighlightTimelineController.cs +++ b/BackEnd/Timeline/Controllers/HighlightTimelineController.cs @@ -2,6 +2,7 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using Timeline.Auth;
+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 all highlight timelines.
/// </summary>
@@ -38,7 +44,7 @@ namespace Timeline.Controllers {
var ids = await _service.GetHighlightTimelines();
var timelines = await _timelineService.GetTimelineList(ids);
- return await _timelineMapper.MapToHttp(timelines, Url, this.GetOptionalUserId());
+ return await Map(timelines);
}
/// <summary>
|