Skip to content

Commit dc89c59

Browse files
committed
Settings and themes API updates
1 parent 882a862 commit dc89c59

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/Core/Api/SettingsController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public async Task<ActionResult<List<SelectListItem>>> GetCultures()
4949
}
5050

5151
/// <summary>
52-
/// Get blog settings
52+
/// Get blog settings (admins only)
5353
/// </summary>
5454
/// <returns>Blog settings</returns>
5555
[HttpGet]
@@ -68,7 +68,7 @@ public async Task<ActionResult<BlogItem>> Get()
6868
}
6969

7070
/// <summary>
71-
/// Save blog settings
71+
/// Save blog settings (admins only)
7272
/// </summary>
7373
/// <param name="model">Blog settings item</param>
7474
/// <returns>Saved blog item</returns>

src/Core/Api/ThemesController.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Core.Data;
22
using Core.Helpers;
33
using Core.Services;
4+
using Microsoft.AspNetCore.Authorization;
45
using Microsoft.AspNetCore.Http;
56
using Microsoft.AspNetCore.Mvc;
67
using System;
@@ -27,10 +28,11 @@ public ThemesController(IDataService data, IStorageService store)
2728
}
2829

2930
/// <summary>
30-
/// Get list of themes
31+
/// Get list of themes (authentication required)
3132
/// </summary>
3233
/// <param name="page">Page number</param>
3334
/// <returns>List of themes</returns>
35+
[Authorize]
3436
[HttpGet]
3537
public async Task<ActionResult<IEnumerable<ThemeItem>>> Get(int page = 1)
3638
{
@@ -48,7 +50,7 @@ public async Task<ActionResult<IEnumerable<ThemeItem>>> Get(int page = 1)
4850
}
4951

5052
/// <summary>
51-
/// Set theme as current for a blog
53+
/// Set theme as current for a blog (admins only)
5254
/// </summary>
5355
/// <param name="id">Theme ID</param>
5456
/// <returns>Success or failure</returns>
@@ -79,7 +81,7 @@ public ActionResult Put(string id)
7981
}
8082

8183
/// <summary>
82-
/// Remove and unistall theme from the blog
84+
/// Remove and unistall theme from the blog (admins only)
8385
/// </summary>
8486
/// <param name="id">Theme ID</param>
8587
/// <returns>Success or failure</returns>

src/Core/CoreAPI.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)