Revert "feat(blog): add Visibility { Private, Public } to gate post reads"
This reverts commit 33ecfa7ebd.
This commit is contained in:
parent
33ecfa7ebd
commit
42625f5ddd
16 changed files with 46 additions and 5427 deletions
|
|
@ -13,7 +13,6 @@ namespace Yavsc.Models
|
|||
using Bank;
|
||||
using Billing;
|
||||
using Blog;
|
||||
using Blogspot;
|
||||
using Chat;
|
||||
using Drawing;
|
||||
using Forms;
|
||||
|
|
@ -223,17 +222,6 @@ namespace Yavsc.Models
|
|||
.WithMany(u => u.Posts)
|
||||
.HasForeignKey(b => b.AuthorId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
// Store Visibility as a plain int (NOT NULL, default
|
||||
// 0 = Private) so existing rows land on the pre-ACL
|
||||
// behaviour by default. System.Text.Json serialises
|
||||
// the enum as its underlying int, so the wire shape
|
||||
// is a plain number — no JsonConverter needed.
|
||||
builder.Entity<BlogPost>()
|
||||
.Property(b => b.Visibility)
|
||||
.HasConversion<int>()
|
||||
.HasDefaultValue(Visibility.Private)
|
||||
.IsRequired();
|
||||
builder.Entity<Comment>()
|
||||
.HasOne(c => c.Author)
|
||||
.WithMany(u => u.BlogComments)
|
||||
|
|
|
|||
|
|
@ -30,21 +30,6 @@ namespace Yavsc.Models.Blog
|
|||
[Display(Name = "Liste de contrôle d'accès")]
|
||||
public virtual List<CircleAuthorizationToBlogPost>? ACL { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Visibility of this post.
|
||||
/// <para><see cref="Visibility.Public"/> reads through the
|
||||
/// ACL (open when the ACL is empty, narrowed by the ACL
|
||||
/// when it is non-empty). <see cref="Visibility.Private"/>
|
||||
/// ignores the ACL at read time and restricts to author +
|
||||
/// administrators. The ACL list is preserved across
|
||||
/// Private/Public flips so re-opening is lossless.</para>
|
||||
/// <para>Configured as <c>int</c> with default
|
||||
/// <see cref="Visibility.Private"/> in
|
||||
/// <c>ApplicationDbContext.OnModelCreating</c>.</para>
|
||||
/// </summary>
|
||||
[Display(Name = "Visibilité")]
|
||||
public Visibility Visibility { get; set; } = Visibility.Private;
|
||||
|
||||
[Display(Name = "Identifiant de l'auteur")]
|
||||
[ForeignKey("Author")]
|
||||
public string? AuthorId { get; set; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue