Skip to content
Snippets Groups Projects
Commit 9816bbf9 authored by Thomas Hackl's avatar Thomas Hackl
Browse files

note creation for non-admin users

parent dcef6aba
No related branches found
No related tags found
No related merge requests found
......@@ -159,9 +159,15 @@ class GitLab
return $note;
} catch (\Gitlab\Exception\RuntimeException $e) {
// If adding has failed because of SUDO (author does not have access to the project), create an issue without SUDO (as the Admin user whose token is configured)
if ($this->isAdmin) {
$note = $this->doCreateNote($projectId, $issueId, $data['markdown'], $authorId, false);
} else {
// If adding has failed for some other reason, propagate the exception back
throw $e;
}
}
}
// Actually creates the issue
private function doCreateIssue($projectId, $title, $description, $createdAt, $assigneeId, $authorId, $labels, $isAdmin) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment