feat/postit-acl #32

Merged
notazof merged 33 commits from feat/postit-acl into release/1.0.7 2026-08-18 16:14:32 +01:00
2 changed files with 4 additions and 6 deletions
Showing only changes of commit 40e5630cfc - Show all commits

refactor(blogacl): move BlogAcl + Circle controllers from Yavsc.Api to Yavsc.Blogs

These two controllers belong to the Blogs subsystem (their routes
/api/blogacl and /api/circle are blog-domain concerns, not the
generic Api surface). Moving them next to BlogApiController keeps
related code together and prepares the PostIt client to consume
them through the same BlogsApiUrl base address as the existing
BlogApiClient.

Mechanical changes only:
- Namespace Yavsc.Controllers -> Yavsc.Blogs.Controllers
- Drop unused 'using Yavsc.Helpers;' (no symbol in the new
  compilation unit depends on it; the build confirms it was
  dead since the controllers were first written)
- Fix typo in CircleApiController route: 'api/cirle' -> 'api/circle'
  (any client trying to call the documented route was hitting 404)

No functional changes to authorization or query shape. The known
security gaps in these controllers (GetBlogACL and GetCircle
return unfiltered collections, DeleteCircle has no ownership
check) are deliberately left untouched in this commit and will
be addressed in a follow-up.
Paul Schneider 2026-08-17 23:34:48 +01:00
Signed by: notazof
GPG key ID: 1DD5D838E5343B06

View file

@ -1,12 +1,11 @@
using System.Security.Claims;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Yavsc.Helpers;
using Yavsc.Models;
using Yavsc.Models.Access;
using Yavsc.Server.Helpers;
namespace Yavsc.Controllers
namespace Yavsc.Blogs.Controllers
{
[Produces("application/json")]
[Route("api/blogacl")]
@ -86,7 +85,7 @@ namespace Yavsc.Controllers
}
private bool CheckOwner (long circleId)
{
var uid = User.FindFirstValue(ClaimTypes.NameIdentifier);
var circle = _context.Circle.First(c=>c.Id==circleId);
_context.Entry(circle).State = EntityState.Detached;

View file

@ -1,14 +1,13 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Yavsc.Helpers;
using Yavsc.Models;
using Yavsc.Models.Relationship;
using Yavsc.Server.Helpers;
namespace Yavsc.Controllers
namespace Yavsc.Blogs.Controllers
{
[Produces("application/json")]
[Route("api/cirle")]
[Route("api/circle")]
public class CircleApiController : Controller
{
private readonly ApplicationDbContext _context;