test(chapters): lock open-contribution upload contract + document intent
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -69,6 +69,21 @@ async fn get_one(
|
||||
Ok(Json(chapter))
|
||||
}
|
||||
|
||||
/// Add a chapter to a manga.
|
||||
///
|
||||
/// **Authorization is intentionally open**: any authenticated principal —
|
||||
/// a browser session *or* a bot API token — may add a chapter to *any*
|
||||
/// manga, including crawler-imported rows. This is by design: chapters are
|
||||
/// treated as community contributions, unlike the manga record itself
|
||||
/// (title/cover/metadata), whose edits gate through `require_can_edit`
|
||||
/// (see [`crate::api::mangas`]). The `CurrentUser` binding still requires a
|
||||
/// valid identity, so contributions are attributable, just not owner-scoped.
|
||||
///
|
||||
/// This contract is locked by `tests/api_chapters.rs`
|
||||
/// (`non_owner_can_upload_chapter`); changing it to owner-only is a
|
||||
/// deliberate decision, not a drive-by tightening. Until a richer
|
||||
/// contributor/moderation model lands this is acknowledged, intended
|
||||
/// behaviour — see the auth note in CLAUDE.md.
|
||||
async fn create(
|
||||
State(state): State<AppState>,
|
||||
CurrentUser(user): CurrentUser,
|
||||
|
||||
Reference in New Issue
Block a user