An incorrect authorization issue exists in the `Ticket::manageMerge()` function. This allows authenticated agents to merge or delete tickets belonging to departments they cannot access. An attacker can manipulate the `tids` parameter of the merge endpoint to hijack a ticket thread and its collaborators, or delete the ticket by setting the `delete-child` parameter to `1`.