- Shipped
- 15 Agosti 2026, 06:17 UTC
- Author
- Kamo
- Commit
- c2a385b
Two things the assignment picker needs. The directory queries take an allowed-id set so a caller can narrow the search to the people a thing may actually be given to — assigning a lead to somebody without VIEW_LEADS parks it where they cannot open it. The set is computed in Java rather than joined here because a right is held either by a rights row or by a grant-all role, and the second has no row to find. It travels with an unrestricted flag and is never empty: IN () is a syntax error on the Postgres wire, so the whole-directory case passes a placeholder instead of nothing. And updateLead now reads an absent assignee id and an empty one as different requests, the way it already does for country and language. A patch carries only the fields it means to change, so without that distinction there was no way to say "nobody owns this lead" — the empty string fell through the same branch as a missing field and the unassign silently did nothing. The open assignment row is closed rather than replaced, since a LeadAssignment always names a member and there is no longer one to name.