╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1522 return; │ │1523 } │ │1524 } │ │1525 + │ │1526 + // a draft is its author's alone, which its edit above checks │ │1527 + if (!try request_repo.source.canModify(io, allocator, actor, parts.thread_kind, &parts.thread_id)) return respondForbidden(request);│ │1528 │ │1529 const not_found = switch (parts.thread_kind) { │ │1530 .issue => "issue not found", │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1577 base: []const u8, │ │1578 host: Host, │ │1579 ) !void { │ │1580 + const parts = commentBaseParts(base) orelse { │ │1581 + try request.respond("thread not found", .{ │ │1582 + .status = .not_found, │ │1583 + .extra_headers = &.{.{ .name = "content-type", .value = "text/plain" }}, │ │1584 + }); │ │1585 + return; │ │1586 + }; │ │1587 + │ │1588 var author_arena = std.heap.ArenaAllocator.init(allocator); │ │1589 defer author_arena.deinit(); │ │1533 - const author = ((try eventAuthor(io, allocator, &author_arena, request, host)) orelse return respondLoginRequired(request)).author;│ │1590 + const author = ((try authorizeWrite(io, allocator, &author_arena, request, host, parts.repo_base, .write)) orelse return).author; │ │1591 │ │1592 const body = try readFormBody(request, allocator); │ │1593 defer allocator.free(body); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1608 try hunks.append(aa, try std.mem.replaceOwned(u8, aa, submitted, "\r\n", "\n")); │ │1609 } │ │1610 │ │1554 - const parts = commentBaseParts(base) orelse { │ │1555 - try request.respond("thread not found", .{ │ │1556 - .status = .not_found, │ │1557 - .extra_headers = &.{.{ .name = "content-type", .value = "text/plain" }}, │ │1558 - }); │ │1559 - return; │ │1560 - }; │ │1611 if (parts.comment_id != null or (parts.thread_kind != .issue and parts.thread_kind != .patch)) {│ │1612 try request.respond("thread not found", .{ │ │1613 .status = .not_found, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯