refacto BlogPost
This commit is contained in:
parent
84f3ffa9c2
commit
e35bc273a3
17 changed files with 177 additions and 203 deletions
|
|
@ -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();
|
||||
}
|
||||
17
src/Yavsc.Abstract/Identity/Security/CircleAuthorization.cs
Normal file
17
src/Yavsc.Abstract/Identity/Security/CircleAuthorization.cs
Normal 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; }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue