╭ changed ─────────╮ │src/event/Repo.zig│ ╰──────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────╮ │3 const xit = @import("xit"); │ │4 const hash = xit.hash; │ │5 │ │6 -user_id: []const u8, │ │6 +user_id: [evt.event_id_size * 2]u8,│ │7 name: []const u8, │ │8 description: []const u8, │ │9 read_access: Access = .private, │ ╰──────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │77 // what the access fields give everyone, logged in or not │ │78 const base_maybe: ?Role = if (record.event.write_access == .public) .write else if (record.event.read_access == .public) .read else null;│ │79 const user_id = user_id_maybe orelse return base_maybe; │ │80 - if (std.mem.eql(u8, record.event.user_id, &user_id)) return .owner; │ │80 + if (std.mem.eql(u8, &record.event.user_id, &std.fmt.bytesToHex(user_id, .lower))) return .owner; │ │81 │ │82 const granted = (try evt.Grant.readRole(DB, hash_kind, user_moment, arena, repo_id, &user_id)) orelse return base_maybe; │ │83 const base = base_maybe orelse return granted; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │127 │ │128 var record_to_write = record_maybe orelse try evt.removedRecord(Record, DB, hash_kind, haxy_moment.readOnly(), existing_record_maybe);│ │129 │ │130 - if (!record_to_write.removed) try validateName(record_to_write.event.name); │ │130 + if (!record_to_write.removed) { │ │131 + _ = try evt.parseEventId(&record_to_write.event.user_id); │ │132 + try validateName(record_to_write.event.name); │ │133 + } │ │134 │ │135 if (existing_record_maybe) |existing_record| { │ │136 // updates preserve the original creation metadata │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯