Add users, roles, and per-novel permissions
Introduces accounts (ASP.NET Identity + cookie auth), four global roles (Admin/Writer/Editor/Reviewer), per-novel ownership and grants via ProjectMember, and a service-API-key principal for the MCP server and background import jobs. Enforcement lives in the application services (not endpoint filters) so the embedded agent and MCP tools, which call the same services directly, can't bypass it. Web client gets a login page, session-aware routing, and a People section for managing per-novel access. Also includes prior in-flight changes from this branch (CLAUDE.md compliance pass, dev-deploy docker-compose setup) that were uncommitted when this feature work started.
This commit is contained in:
@@ -11,7 +11,7 @@ namespace Novelly.Api.Tests;
|
||||
public class LoggingTests : ServiceTestFixture
|
||||
{
|
||||
[Test]
|
||||
public async Task Fetching_a_missing_chapter_returns_null_and_logs_at_information_not_warning()
|
||||
public async Task Fetching_a_missing_chapter_returns_null_and_logs_a_warning()
|
||||
{
|
||||
var missingId = Guid.NewGuid();
|
||||
|
||||
@@ -20,10 +20,9 @@ public class LoggingTests : ServiceTestFixture
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(result, Is.Null);
|
||||
Assert.That(ChapterLogs.Entries.Where(e => e.Level == LogLevel.Warning), Is.Empty);
|
||||
Assert.That(
|
||||
ChapterLogs.Entries,
|
||||
Has.Some.Matches<CapturedLogEntry>(e => e.Level == LogLevel.Information && e.Message.Contains(missingId.ToString())));
|
||||
Has.Some.Matches<CapturedLogEntry>(e => e.Level == LogLevel.Warning && e.Message.Contains(missingId.ToString())));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user