refacto BlogPost

This commit is contained in:
Paul Schneider 2026-08-19 14:09:31 +01:00
commit e35bc273a3
Signed by: notazof
GPG key ID: 1DD5D838E5343B06
17 changed files with 177 additions and 203 deletions

View file

@ -1,4 +1,3 @@
using System;
using Yavsc.Abstract.Identity.Security;
namespace Yavsc.Blogspot;
@ -30,18 +29,17 @@ public class BlogPostDto : IBlogPost
/// </summary>
public bool IsPublished { get; set; }
public bool AuthorizeCircle(long circleId)
public virtual bool AuthorizeCircle(long circleId)
{
throw new NotImplementedException();
ACL.Add(new CircleAuthorization { CircleId = circleId });
return true;
}
public ICircleAuthorization[] GetACL()
{
throw new NotImplementedException();
}
private List<CircleAuthorization> ACL { get; set; } = new List<CircleAuthorization>();
public string[] GetTags()
{
throw new NotImplementedException();
}
public string[] Tags { get; set; }
public string[] GetTags() => Tags;
public ICircleAuthorization[] GetACL() => ACL.ToArray();
}

View file

@ -0,0 +1,17 @@
namespace Yavsc.Abstract.Identity.Security;
/// <summary>
/// Wire format for <c>GET /api/blogacl</c> and friends.
///
/// <para>The server-side
/// <c>Yavsc.Models.Access.CircleAuthorizationToBlogPost</c> EF entity
/// carries virtual navigation properties (<c>Target</c>,
/// <c>Allowed</c>) that pull in the full BlogPost and Circle graphs.
/// The client never needs them: when showing the ACL of a post, the
/// UI already has the post, and the circles are looked up by id
/// against the list returned by <c>GET /api/circle</c>.</para>
/// </summary>
public sealed class CircleAuthorization : ICircleAuthorization
{
public long CircleId { get; set; }
}