{"action":"created","comment":{"url":"https://api.github.com/repos/omegaup/omegaup/pulls/comments/167967806","pull_request_review_id":96261238,"id":167967806,"diff_hunk":"@@ -537,6 +538,42 @@ public static function apiRemoveTag(Request $r) {\n         return ['status' => 'ok'];\n     }\n \n+    /**\n+     * Removes a problem whether user is the creator\n+     *\n+     * @param Request $r\n+     * @return array\n+     * @throws InvalidDatabaseOperationException\n+     * @throws ForbiddenAccessException\n+     */\n+    public static function apiDelete(Request $r) {\n+        // Authenticate logged user\n+        self::authenticateRequest($r);\n+\n+        // Check whether problem exists\n+        Validators::isStringNonEmpty($r['problem_alias'], 'problem_alias');\n+\n+        try {\n+            $problem = ProblemsDAO::getByAlias($r['problem_alias']);\n+        } catch (Exception $e) {\n+            // Operation failed in the data layer\n+            throw new InvalidDatabaseOperationException($e);\n+        }\n+\n+        if (!Authorization::canEditProblem($r['current_user_id'], $problem)) {\n+            throw new ForbiddenAccessException();\n+        }\n+\n+        try {","path":"frontend/server/controllers/ProblemController.php","position":null,"original_position":38,"commit_id":"af9600bcca202ec299080b780f93826856c4e00c","original_commit_id":"a443189489dc947643535edf97ff0aa79ac38c63","user":{"login":"pabo99","id":3230352,"avatar_url":"https://avatars0.githubusercontent.com/u/3230352?v=4","gravatar_id":"","url":"https://api.github.com/users/pabo99","html_url":"https://github.com/pabo99","followers_url":"https://api.github.com/users/pabo99/followers","following_url":"https://api.github.com/users/pabo99/following{/other_user}","gists_url":"https://api.github.com/users/pabo99/gists{/gist_id}","starred_url":"https://api.github.com/users/pabo99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pabo99/subscriptions","organizations_url":"https://api.github.com/users/pabo99/orgs","repos_url":"https://api.github.com/users/pabo99/repos","events_url":"https://api.github.com/users/pabo99/events{/privacy}","received_events_url":"https://api.github.com/users/pabo99/received_events","type":"User","site_admin":false},"body":"Listo, se agrega la restricción de que un usuario no pueda eliminar un problema que ya se usó en algún curso o concurso. Aún se dejó la opción de eliminar el problema si sólo se ha usado para prácticas.","created_at":"2018-02-13T19:03:19Z","updated_at":"2018-02-13T19:03:19Z","html_url":"https://github.com/omegaup/omegaup/pull/1735#discussion_r167967806","pull_request_url":"https://api.github.com/repos/omegaup/omegaup/pulls/1735","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/omegaup/omegaup/pulls/comments/167967806"},"html":{"href":"https://github.com/omegaup/omegaup/pull/1735#discussion_r167967806"},"pull_request":{"href":"https://api.github.com/repos/omegaup/omegaup/pulls/1735"}},"in_reply_to_id":167417638},"pull_request":{"url":"https://api.github.com/repos/omegaup/omegaup/pulls/1735","id":168260757,"html_url":"https://github.com/omegaup/omegaup/pull/1735","diff_url":"https://github.com/omegaup/omegaup/pull/1735.diff","patch_url":"https://github.com/omegaup/omegaup/pull/1735.patch","issue_url":"https://api.github.com/repos/omegaup/omegaup/issues/1735","number":1735,"state":"open","locked":false,"title":"Agregando la opcion de que un usuario pueda eliminar sus propios problemas","user":{"login":"pabo99","id":3230352,"avatar_url":"https://avatars0.githubusercontent.com/u/3230352?v=4","gravatar_id":"","url":"https://api.github.com/users/pabo99","html_url":"https://github.com/pabo99","followers_url":"https://api.github.com/users/pabo99/followers","following_url":"https://api.github.com/users/pabo99/following{/other_user}","gists_url":"https://api.github.com/users/pabo99/gists{/gist_id}","starred_url":"https://api.github.com/users/pabo99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pabo99/subscriptions","organizations_url":"https://api.github.com/users/pabo99/orgs","repos_url":"https://api.github.com/users/pabo99/repos","events_url":"https://api.github.com/users/pabo99/events{/privacy}","received_events_url":"https://api.github.com/users/pabo99/received_events","type":"User","site_admin":false},"body":"Se agrega la funcionalidad de que un usuario pueda eliminar os problemas que el creó.\r\n\r\nFixes #1568 ","created_at":"2018-02-09T15:00:25Z","updated_at":"2018-02-13T19:03:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"79f216b6fe3476a6f18be44e6a92c816822970f6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/omegaup/omegaup/pulls/1735/commits","review_comments_url":"https://api.github.com/repos/omegaup/omegaup/pulls/1735/comments","review_comment_url":"https://api.github.com/repos/omegaup/omegaup/pulls/comments{/number}","comments_url":"https://api.github.com/repos/omegaup/omegaup/issues/1735/comments","statuses_url":"https://api.github.com/repos/omegaup/omegaup/statuses/af9600bcca202ec299080b780f93826856c4e00c","head":{"label":"pabo99:user-can-delete-own-problems","ref":"user-can-delete-own-problems","sha":"af9600bcca202ec299080b780f93826856c4e00c","user":{"login":"pabo99","id":3230352,"avatar_url":"https://avatars0.githubusercontent.com/u/3230352?v=4","gravatar_id":"","url":"https://api.github.com/users/pabo99","html_url":"https://github.com/pabo99","followers_url":"https://api.github.com/users/pabo99/followers","following_url":"https://api.github.com/users/pabo99/following{/other_user}","gists_url":"https://api.github.com/users/pabo99/gists{/gist_id}","starred_url":"https://api.github.com/users/pabo99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pabo99/subscriptions","organizations_url":"https://api.github.com/users/pabo99/orgs","repos_url":"https://api.github.com/users/pabo99/repos","events_url":"https://api.github.com/users/pabo99/events{/privacy}","received_events_url":"https://api.github.com/users/pabo99/received_events","type":"User","site_admin":false},"repo":{"id":101674377,"name":"omegaup","full_name":"pabo99/omegaup","owner":{"login":"pabo99","id":3230352,"avatar_url":"https://avatars0.githubusercontent.com/u/3230352?v=4","gravatar_id":"","url":"https://api.github.com/users/pabo99","html_url":"https://github.com/pabo99","followers_url":"https://api.github.com/users/pabo99/followers","following_url":"https://api.github.com/users/pabo99/following{/other_user}","gists_url":"https://api.github.com/users/pabo99/gists{/gist_id}","starred_url":"https://api.github.com/users/pabo99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pabo99/subscriptions","organizations_url":"https://api.github.com/users/pabo99/orgs","repos_url":"https://api.github.com/users/pabo99/repos","events_url":"https://api.github.com/users/pabo99/events{/privacy}","received_events_url":"https://api.github.com/users/pabo99/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pabo99/omegaup","description":"omegaUp automatic programming contest evaluator & arena","fork":true,"url":"https://api.github.com/repos/pabo99/omegaup","forks_url":"https://api.github.com/repos/pabo99/omegaup/forks","keys_url":"https://api.github.com/repos/pabo99/omegaup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pabo99/omegaup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pabo99/omegaup/teams","hooks_url":"https://api.github.com/repos/pabo99/omegaup/hooks","issue_events_url":"https://api.github.com/repos/pabo99/omegaup/issues/events{/number}","events_url":"https://api.github.com/repos/pabo99/omegaup/events","assignees_url":"https://api.github.com/repos/pabo99/omegaup/assignees{/user}","branches_url":"https://api.github.com/repos/pabo99/omegaup/branches{/branch}","tags_url":"https://api.github.com/repos/pabo99/omegaup/tags","blobs_url":"https://api.github.com/repos/pabo99/omegaup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pabo99/omegaup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pabo99/omegaup/git/refs{/sha}","trees_url":"https://api.github.com/repos/pabo99/omegaup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pabo99/omegaup/statuses/{sha}","languages_url":"https://api.github.com/repos/pabo99/omegaup/languages","stargazers_url":"https://api.github.com/repos/pabo99/omegaup/stargazers","contributors_url":"https://api.github.com/repos/pabo99/omegaup/contributors","subscribers_url":"https://api.github.com/repos/pabo99/omegaup/subscribers","subscription_url":"https://api.github.com/repos/pabo99/omegaup/subscription","commits_url":"https://api.github.com/repos/pabo99/omegaup/commits{/sha}","git_commits_url":"https://api.github.com/repos/pabo99/omegaup/git/commits{/sha}","comments_url":"https://api.github.com/repos/pabo99/omegaup/comments{/number}","issue_comment_url":"https://api.github.com/repos/pabo99/omegaup/issues/comments{/number}","contents_url":"https://api.github.com/repos/pabo99/omegaup/contents/{+path}","compare_url":"https://api.github.com/repos/pabo99/omegaup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pabo99/omegaup/merges","archive_url":"https://api.github.com/repos/pabo99/omegaup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pabo99/omegaup/downloads","issues_url":"https://api.github.com/repos/pabo99/omegaup/issues{/number}","pulls_url":"https://api.github.com/repos/pabo99/omegaup/pulls{/number}","milestones_url":"https://api.github.com/repos/pabo99/omegaup/milestones{/number}","notifications_url":"https://api.github.com/repos/pabo99/omegaup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pabo99/omegaup/labels{/name}","releases_url":"https://api.github.com/repos/pabo99/omegaup/releases{/id}","deployments_url":"https://api.github.com/repos/pabo99/omegaup/deployments","created_at":"2017-08-28T18:28:19Z","updated_at":"2017-08-28T18:28:22Z","pushed_at":"2018-02-13T18:48:06Z","git_url":"git://github.com/pabo99/omegaup.git","ssh_url":"git@github.com:pabo99/omegaup.git","clone_url":"https://github.com/pabo99/omegaup.git","svn_url":"https://github.com/pabo99/omegaup","homepage":"https://omegaup.com","size":224883,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"omegaup:master","ref":"master","sha":"a4446b970ec46197efb69cc67f25c289a32a788e","user":{"login":"omegaup","id":558429,"avatar_url":"https://avatars0.githubusercontent.com/u/558429?v=4","gravatar_id":"","url":"https://api.github.com/users/omegaup","html_url":"https://github.com/omegaup","followers_url":"https://api.github.com/users/omegaup/followers","following_url":"https://api.github.com/users/omegaup/following{/other_user}","gists_url":"https://api.github.com/users/omegaup/gists{/gist_id}","starred_url":"https://api.github.com/users/omegaup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omegaup/subscriptions","organizations_url":"https://api.github.com/users/omegaup/orgs","repos_url":"https://api.github.com/users/omegaup/repos","events_url":"https://api.github.com/users/omegaup/events{/privacy}","received_events_url":"https://api.github.com/users/omegaup/received_events","type":"Organization","site_admin":false},"repo":{"id":1243685,"name":"omegaup","full_name":"omegaup/omegaup","owner":{"login":"omegaup","id":558429,"avatar_url":"https://avatars0.githubusercontent.com/u/558429?v=4","gravatar_id":"","url":"https://api.github.com/users/omegaup","html_url":"https://github.com/omegaup","followers_url":"https://api.github.com/users/omegaup/followers","following_url":"https://api.github.com/users/omegaup/following{/other_user}","gists_url":"https://api.github.com/users/omegaup/gists{/gist_id}","starred_url":"https://api.github.com/users/omegaup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omegaup/subscriptions","organizations_url":"https://api.github.com/users/omegaup/orgs","repos_url":"https://api.github.com/users/omegaup/repos","events_url":"https://api.github.com/users/omegaup/events{/privacy}","received_events_url":"https://api.github.com/users/omegaup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/omegaup/omegaup","description":"omegaUp automatic programming contest evaluator & arena","fork":false,"url":"https://api.github.com/repos/omegaup/omegaup","forks_url":"https://api.github.com/repos/omegaup/omegaup/forks","keys_url":"https://api.github.com/repos/omegaup/omegaup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/omegaup/omegaup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/omegaup/omegaup/teams","hooks_url":"https://api.github.com/repos/omegaup/omegaup/hooks","issue_events_url":"https://api.github.com/repos/omegaup/omegaup/issues/events{/number}","events_url":"https://api.github.com/repos/omegaup/omegaup/events","assignees_url":"https://api.github.com/repos/omegaup/omegaup/assignees{/user}","branches_url":"https://api.github.com/repos/omegaup/omegaup/branches{/branch}","tags_url":"https://api.github.com/repos/omegaup/omegaup/tags","blobs_url":"https://api.github.com/repos/omegaup/omegaup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/omegaup/omegaup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/omegaup/omegaup/git/refs{/sha}","trees_url":"https://api.github.com/repos/omegaup/omegaup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/omegaup/omegaup/statuses/{sha}","languages_url":"https://api.github.com/repos/omegaup/omegaup/languages","stargazers_url":"https://api.github.com/repos/omegaup/omegaup/stargazers","contributors_url":"https://api.github.com/repos/omegaup/omegaup/contributors","subscribers_url":"https://api.github.com/repos/omegaup/omegaup/subscribers","subscription_url":"https://api.github.com/repos/omegaup/omegaup/subscription","commits_url":"https://api.github.com/repos/omegaup/omegaup/commits{/sha}","git_commits_url":"https://api.github.com/repos/omegaup/omegaup/git/commits{/sha}","comments_url":"https://api.github.com/repos/omegaup/omegaup/comments{/number}","issue_comment_url":"https://api.github.com/repos/omegaup/omegaup/issues/comments{/number}","contents_url":"https://api.github.com/repos/omegaup/omegaup/contents/{+path}","compare_url":"https://api.github.com/repos/omegaup/omegaup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/omegaup/omegaup/merges","archive_url":"https://api.github.com/repos/omegaup/omegaup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/omegaup/omegaup/downloads","issues_url":"https://api.github.com/repos/omegaup/omegaup/issues{/number}","pulls_url":"https://api.github.com/repos/omegaup/omegaup/pulls{/number}","milestones_url":"https://api.github.com/repos/omegaup/omegaup/milestones{/number}","notifications_url":"https://api.github.com/repos/omegaup/omegaup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/omegaup/omegaup/labels{/name}","releases_url":"https://api.github.com/repos/omegaup/omegaup/releases{/id}","deployments_url":"https://api.github.com/repos/omegaup/omegaup/deployments","created_at":"2011-01-12T00:11:21Z","updated_at":"2018-02-13T07:17:50Z","pushed_at":"2018-02-13T18:48:07Z","git_url":"git://github.com/omegaup/omegaup.git","ssh_url":"git@github.com:omegaup/omegaup.git","clone_url":"https://github.com/omegaup/omegaup.git","svn_url":"https://github.com/omegaup/omegaup","homepage":"https://omegaup.com","size":224866,"stargazers_count":41,"watchers_count":41,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":59,"mirror_url":null,"archived":false,"open_issues_count":209,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":59,"open_issues":209,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/omegaup/omegaup/pulls/1735"},"html":{"href":"https://github.com/omegaup/omegaup/pull/1735"},"issue":{"href":"https://api.github.com/repos/omegaup/omegaup/issues/1735"},"comments":{"href":"https://api.github.com/repos/omegaup/omegaup/issues/1735/comments"},"review_comments":{"href":"https://api.github.com/repos/omegaup/omegaup/pulls/1735/comments"},"review_comment":{"href":"https://api.github.com/repos/omegaup/omegaup/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/omegaup/omegaup/pulls/1735/commits"},"statuses":{"href":"https://api.github.com/repos/omegaup/omegaup/statuses/af9600bcca202ec299080b780f93826856c4e00c"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"pabo99"}}