diff options
author | crupest <crupest@outlook.com> | 2021-02-13 16:01:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-13 16:01:20 +0800 |
commit | 42034bfb60c03b30dec6ddc93d35ced29070b0e7 (patch) | |
tree | fe1aaea4f34c227b2bcf5fdad77c7e2a85b7923b /BackEnd/Timeline/Controllers/BookmarkTimelineController.cs | |
parent | 99d525560f6aefa5f5fb63e3ba2fff3b557d61f6 (diff) | |
parent | 2d9ca08366d91c22877cee143f43a062d4efda2d (diff) | |
download | timeline-42034bfb60c03b30dec6ddc93d35ced29070b0e7.tar.gz timeline-42034bfb60c03b30dec6ddc93d35ced29070b0e7.tar.bz2 timeline-42034bfb60c03b30dec6ddc93d35ced29070b0e7.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.cs | 8 |
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>
|