/** * POST /issues/undelete/@id * Un-delete an issue * * @param \Base $f3 * @param array $params * @throws \Exception */ public function single_undelete($f3, $params) { $issue = new \Model\Issue(); $issue->load($params["id"]); $user = $f3->get("user_obj"); if ($user->role == "admin" || $user->rank >= \Model\User::RANK_MANAGER || $issue->author_id == $user->id) { $issue->restore(); $f3->reroute("/issues/{$issue->id}"); } else { $f3->error(403); } }