feat(admin): port site administration to API and PostIt
Some checks failed
Dotnet build and test / build (push) Failing after 13m0s
Forgejo Release / release (push) Successful in 8m1s

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Paul Schneider 2026-10-18 18:47:12 +01:00
commit 04c42d9380
Signed by: notazof
GPG key ID: AD4B9B545FBD7D12
29 changed files with 2580 additions and 53 deletions

View file

@ -7,7 +7,7 @@ using Yavsc.Server.Helpers;
namespace Yavsc.Controllers
{
[Produces("application/json"), Authorize]
[Produces("application/json"), Authorize("AdministratorOnly")]
[Route(Constants.APIPrefix + "/users")]
public class ApplicationUserApiController : Controller
{
@ -19,7 +19,7 @@ namespace Yavsc.Controllers
}
// GET: api/ApplicationUserApi
[HttpGet, Authorize(Roles = Constants.AdminGroupName + "," + Constants.BlogModeratorGroupName)]
[HttpGet]
public IEnumerable<UserInfo> GetApplicationUser(int skip=0, int take = 25)
{
return _context.Users
@ -41,7 +41,7 @@ namespace Yavsc.Controllers
});
}
[HttpGet("search/{pattern}"), Authorize(Roles = Constants.AdminGroupName + "," + Constants.BlogModeratorGroupName)]
[HttpGet("search/{pattern}")]
public IEnumerable<UserInfo> SearchApplicationUser(string pattern, int skip=0, int take = 25)
{
var normalizedPattern = pattern ?? string.Empty;