╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ───────────────╮ │src/ui/widget/thread.zig│ ╰────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2701 if (comptime wasm) return; │ │2702 const io = self.session.io orelse return; │ │2703 const src = self.data.repo_source orelse return; │ │2703 - const actor = (try self.session.authorize(self.data.identity, .read)) orelse return; │ │2704 + const actor = (try self.session.authorize(self.data.identity, .read, kind)) orelse return;│ │2705 │ │2706 const form = self.threadForm() orelse return; │ │2707 const title_input = try formField(form, "title"); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2784 if (comptime wasm) return; │ │2785 const io = self.session.io orelse return; │ │2786 const entry = self.data.selectedThread() orelse return; │ │2786 - const actor = (try self.session.authorize(self.data.identity, .read)) orelse return; │ │2787 + const actor = (try self.session.authorize(self.data.identity, .read, kind)) orelse return;│ │2788 const author = actor.author; │ │2789 │ │2790 const form = self.threadForm() orelse return; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2884 if (comptime wasm) return; │ │2885 const entry = self.data.selectedThread() orelse return; │ │2886 if (!entryDraft(entry.*)) return; │ │2886 - const author = ((try self.session.authorize(self.data.identity, .read)) orelse return).author; │ │2887 + const author = ((try self.session.authorize(self.data.identity, .read, kind)) orelse return).author; │ │2888 try self.data.publishDraft(self.session, allocator, author, entry.id); │ │2889 const route = listRoute(self.data.identity, @fromBackingInt(@intCast(0)), "", entry.id) orelse return;│ │2890 try self.session.navigate(route); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2894 const entry = self.data.selectedThread() orelse return; │ │2895 const revision: evt.Patch.MergeRevision = if (button_index > 1) .squash else .source; │ │2896 if (!Data.canMerge(entry.*, self.session) or entry.mergeability.get(revision) != .clean) return; │ │2896 - const author = ((try self.session.authorize(self.data.identity, .write)) orelse return).author; │ │2897 + const author = ((try self.session.authorize(self.data.identity, .write, kind)) orelse return).author; │ │2898 self.data.mergePatch(self.session, allocator, author, entry.id, revision) catch |err| switch (err) { │ │2899 error.MergeConflict, error.MergeCheckUnavailable, error.PatchOutOfDate, error.PatchDataUnavailable => {│ │2900 const route = listRoute(self.data.identity, entryStatus(entry.*), "", entry.id) orelse return; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2920 │ │2921 fn removeEvent(self: *This, allocator: std.mem.Allocator, event_kind: evt.EventKind, id: [evt.event_id_size]u8) !void {│ │2922 if (comptime wasm) return; │ │2922 - const actor = (try self.session.authorize(self.data.identity, .read)) orelse return; │ │2923 + const actor = (try self.session.authorize(self.data.identity, .read, kind)) orelse return; │ │2924 const author = actor.author; │ │2925 │ │2926 if (comptime supports_drafts) { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │2936 const io = self.session.io orelse return; │ │2937 const src = self.data.repo_source orelse return; │ │2938 if (!try src.canModify(io, allocator, actor, event_kind, &id)) return; │ │2939 + const thread_id = evt.parseEventId(self.data.selected_id) catch return;│ │2940 │ │2941 switch (src.repo_kind) { │ │2942 inline else => |repo_kind| { │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2943 var any_repo = try rp.AnyRepo(repo_kind, .{}).open(io, allocator, src.localInitOpts()); │ │2944 defer any_repo.deinit(io, allocator); │ │2945 switch (any_repo) { │ │2944 - inline else => |*repo| try evt.remove(self.session.eventHost(), .repo, repo_kind, repo.self_repo_opts, io, allocator, repo, &id, event_kind, author), │ │2946 + inline else => |*repo| try evt.removeInThread(self.session.eventHost(), repo_kind, repo.self_repo_opts, io, allocator, repo, kind, &thread_id, event_kind, &id, author),│ │2947 } │ │2948 }, │ │2949 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │482 }); │ │483 } │ │484 │ │485 -// the actor for a write to the repo `repo_base` names with at least `min_role`,│ │486 -// or null once the refusal has been sent. local mode always writes. │ │485 +// the actor for a write to the repo `repo_base` names with at least `min_role` │ │486 +// and in the `thread_kind` tab when there is one, or null once the refusal has │ │487 +// been sent. local mode always writes. │ │488 fn authorizeWrite( │ │489 io: std.Io, │ │490 allocator: std.mem.Allocator, │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────╮ │493 host: Host, │ │494 repo_base: []const u8, │ │495 min_role: evt.Repo.Role, │ │496 + thread_kind: ?evt.EventKind, │ │497 ) !?ui.Actor { │ │498 const server = switch (host) { │ │499 .server => |server| server,│ ╰────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │507 var admin_repo = try rp.Repo(.xit, evt.admin_repo_opts).open(io, allocator, .{ .path = server.admin_repo_path });│ │508 defer admin_repo.deinit(io, allocator); │ │509 const moment = try evt.currentMoment(evt.admin_repo_opts, &admin_repo); │ │508 - break :blk try ui.authorizeUser(io, moment, arena, server.users_dir, user_id, identity, min_role); │ │510 + break :blk try ui.authorizeUser(io, moment, arena, server.users_dir, user_id, identity, min_role, thread_kind); │ │511 }; │ │512 switch (authorization) { │ │513 .actor => |actor| return actor, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯