Bug fix - notifications audience

* Performers had their notifications publicaly published.
* refacto admin group name
This commit is contained in:
Paul Schneider 2026-10-23 13:32:42 +01:00
commit d476c08046
Signed by: notazof
GPG key ID: AD4B9B545FBD7D12
36 changed files with 421 additions and 74 deletions

View file

@ -50,9 +50,14 @@ namespace Yavsc.Controllers
if (clicked == null) clicked = new long[0];
}
else clicked = _dbContext.DismissClicked.Where(d => d.UserId == uid).Select(d => d.NotificationId).ToArray();
var isAdmin = User.IsInRole(Constants.AdminName);
var notes = _dbContext.Notification.Where(
n => !clicked.Contains(n.Id)
);
).Where(n =>
string.IsNullOrWhiteSpace(n.Target)
|| (n.Target != null && n.Target.StartsWith("pub/"))
|| (!string.IsNullOrWhiteSpace(uid) && n.Target == $"user/{uid}")
|| (isAdmin && n.Target == Constants.Administration));
if (notes.Any()) this.Notify(notes);
var toShow = _dbContext.Activities