{"action":"created","comment":{"url":"https://api.github.com/repos/matecat/paypal_plugin/pulls/comments/156498226","pull_request_review_id":82985859,"id":156498226,"diff_hunk":"@@ -25,19 +25,26 @@ public function validate() {\n \n         $user    = $this->controller->getUser();\n         $project = $this->controller->getProject();\n-        $membership_dao = new MembershipDao;\n-\n-        if (! $membership_dao->findTeamByIdAndUser( $project->id_team, $user ) ) { // not is in team\n-\n-            $metadata_dao = new Projects_MetadataDao;\n-            $metadata     = $metadata_dao->get( $project->id, Constants::PAYPAL_WHITELIST_KEY );\n-            $metadata_value = json_decode($metadata->value);\n \n-            if ( !in_array( $user->getEmail(), $metadata_value->emails ) ) { // not is in whitelist\n-                throw new AuthenticationError( \"Nein\" );\n+        $membership_dao = new MembershipDao;\n+        /*\n+         * $project is null only when controller is supposed to handle multiple projects,\n+         * in the other cases the user must to be validated when bumps into a project\n+         */\n+        if($project != null){\n+            if (! $membership_dao->findTeamByIdAndUser( $project->id_team, $user ) ) { // not is in team\n+\n+                $metadata_dao = new Projects_MetadataDao;\n+                $metadata     = $metadata_dao->get( $project->id, Constants::PAYPAL_WHITELIST_KEY );\n+                $metadata_value = json_decode($metadata->value);\n+\n+                if ( !in_array( $user->getEmail(), $metadata_value->emails ) ) { // not is in whitelist\n+                    throw new AuthenticationError( \"Nein\" );","path":"lib/Features/Paypal/Controller/API/Validators/TranslatorsWhitelistAccessValidator.php","position":27,"original_position":27,"commit_id":"9ab4bddcaf2d3b4e2a548005e5e8e1a161171dff","original_commit_id":"9ab4bddcaf2d3b4e2a548005e5e8e1a161171dff","user":{"login":"Ostico","id":8008416,"avatar_url":"https://avatars1.githubusercontent.com/u/8008416?v=4","gravatar_id":"","url":"https://api.github.com/users/Ostico","html_url":"https://github.com/Ostico","followers_url":"https://api.github.com/users/Ostico/followers","following_url":"https://api.github.com/users/Ostico/following{/other_user}","gists_url":"https://api.github.com/users/Ostico/gists{/gist_id}","starred_url":"https://api.github.com/users/Ostico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ostico/subscriptions","organizations_url":"https://api.github.com/users/Ostico/orgs","repos_url":"https://api.github.com/users/Ostico/repos","events_url":"https://api.github.com/users/Ostico/events{/privacy}","received_events_url":"https://api.github.com/users/Ostico/received_events","type":"User","site_admin":false},"body":"Sorry about that, _Nein_ was a joke, i wrote it only for test. Please correct, this is my fault.","created_at":"2017-12-12T21:19:40Z","updated_at":"2017-12-12T21:21:42Z","html_url":"https://github.com/matecat/paypal_plugin/pull/5#discussion_r156498226","pull_request_url":"https://api.github.com/repos/matecat/paypal_plugin/pulls/5","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/matecat/paypal_plugin/pulls/comments/156498226"},"html":{"href":"https://github.com/matecat/paypal_plugin/pull/5#discussion_r156498226"},"pull_request":{"href":"https://api.github.com/repos/matecat/paypal_plugin/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/matecat/paypal_plugin/pulls/5","id":157900065,"html_url":"https://github.com/matecat/paypal_plugin/pull/5","diff_url":"https://github.com/matecat/paypal_plugin/pull/5.diff","patch_url":"https://github.com/matecat/paypal_plugin/pull/5.patch","issue_url":"https://api.github.com/repos/matecat/paypal_plugin/issues/5","number":5,"state":"open","locked":false,"title":"improvement whitelist with logic delete + fix control project is null","user":{"login":"vincy","id":1022901,"avatar_url":"https://avatars3.githubusercontent.com/u/1022901?v=4","gravatar_id":"","url":"https://api.github.com/users/vincy","html_url":"https://github.com/vincy","followers_url":"https://api.github.com/users/vincy/followers","following_url":"https://api.github.com/users/vincy/following{/other_user}","gists_url":"https://api.github.com/users/vincy/gists{/gist_id}","starred_url":"https://api.github.com/users/vincy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincy/subscriptions","organizations_url":"https://api.github.com/users/vincy/orgs","repos_url":"https://api.github.com/users/vincy/repos","events_url":"https://api.github.com/users/vincy/events{/privacy}","received_events_url":"https://api.github.com/users/vincy/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-12-12T18:07:59Z","updated_at":"2017-12-12T21:21:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af120a4e4fe69a34603a00534ba9f5df199ec4d8","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/matecat/paypal_plugin/pulls/5/commits","review_comments_url":"https://api.github.com/repos/matecat/paypal_plugin/pulls/5/comments","review_comment_url":"https://api.github.com/repos/matecat/paypal_plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matecat/paypal_plugin/issues/5/comments","statuses_url":"https://api.github.com/repos/matecat/paypal_plugin/statuses/9ab4bddcaf2d3b4e2a548005e5e8e1a161171dff","head":{"label":"vincy:master","ref":"master","sha":"9ab4bddcaf2d3b4e2a548005e5e8e1a161171dff","user":{"login":"vincy","id":1022901,"avatar_url":"https://avatars3.githubusercontent.com/u/1022901?v=4","gravatar_id":"","url":"https://api.github.com/users/vincy","html_url":"https://github.com/vincy","followers_url":"https://api.github.com/users/vincy/followers","following_url":"https://api.github.com/users/vincy/following{/other_user}","gists_url":"https://api.github.com/users/vincy/gists{/gist_id}","starred_url":"https://api.github.com/users/vincy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincy/subscriptions","organizations_url":"https://api.github.com/users/vincy/orgs","repos_url":"https://api.github.com/users/vincy/repos","events_url":"https://api.github.com/users/vincy/events{/privacy}","received_events_url":"https://api.github.com/users/vincy/received_events","type":"User","site_admin":false},"repo":{"id":113207463,"name":"paypal_plugin","full_name":"vincy/paypal_plugin","owner":{"login":"vincy","id":1022901,"avatar_url":"https://avatars3.githubusercontent.com/u/1022901?v=4","gravatar_id":"","url":"https://api.github.com/users/vincy","html_url":"https://github.com/vincy","followers_url":"https://api.github.com/users/vincy/followers","following_url":"https://api.github.com/users/vincy/following{/other_user}","gists_url":"https://api.github.com/users/vincy/gists{/gist_id}","starred_url":"https://api.github.com/users/vincy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincy/subscriptions","organizations_url":"https://api.github.com/users/vincy/orgs","repos_url":"https://api.github.com/users/vincy/repos","events_url":"https://api.github.com/users/vincy/events{/privacy}","received_events_url":"https://api.github.com/users/vincy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vincy/paypal_plugin","description":null,"fork":true,"url":"https://api.github.com/repos/vincy/paypal_plugin","forks_url":"https://api.github.com/repos/vincy/paypal_plugin/forks","keys_url":"https://api.github.com/repos/vincy/paypal_plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vincy/paypal_plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vincy/paypal_plugin/teams","hooks_url":"https://api.github.com/repos/vincy/paypal_plugin/hooks","issue_events_url":"https://api.github.com/repos/vincy/paypal_plugin/issues/events{/number}","events_url":"https://api.github.com/repos/vincy/paypal_plugin/events","assignees_url":"https://api.github.com/repos/vincy/paypal_plugin/assignees{/user}","branches_url":"https://api.github.com/repos/vincy/paypal_plugin/branches{/branch}","tags_url":"https://api.github.com/repos/vincy/paypal_plugin/tags","blobs_url":"https://api.github.com/repos/vincy/paypal_plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vincy/paypal_plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vincy/paypal_plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/vincy/paypal_plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vincy/paypal_plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/vincy/paypal_plugin/languages","stargazers_url":"https://api.github.com/repos/vincy/paypal_plugin/stargazers","contributors_url":"https://api.github.com/repos/vincy/paypal_plugin/contributors","subscribers_url":"https://api.github.com/repos/vincy/paypal_plugin/subscribers","subscription_url":"https://api.github.com/repos/vincy/paypal_plugin/subscription","commits_url":"https://api.github.com/repos/vincy/paypal_plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/vincy/paypal_plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/vincy/paypal_plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/vincy/paypal_plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/vincy/paypal_plugin/contents/{+path}","compare_url":"https://api.github.com/repos/vincy/paypal_plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vincy/paypal_plugin/merges","archive_url":"https://api.github.com/repos/vincy/paypal_plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vincy/paypal_plugin/downloads","issues_url":"https://api.github.com/repos/vincy/paypal_plugin/issues{/number}","pulls_url":"https://api.github.com/repos/vincy/paypal_plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/vincy/paypal_plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/vincy/paypal_plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vincy/paypal_plugin/labels{/name}","releases_url":"https://api.github.com/repos/vincy/paypal_plugin/releases{/id}","deployments_url":"https://api.github.com/repos/vincy/paypal_plugin/deployments","created_at":"2017-12-05T16:39:17Z","updated_at":"2017-12-05T16:39:18Z","pushed_at":"2017-12-11T16:00:08Z","git_url":"git://github.com/vincy/paypal_plugin.git","ssh_url":"git@github.com:vincy/paypal_plugin.git","clone_url":"https://github.com/vincy/paypal_plugin.git","svn_url":"https://github.com/vincy/paypal_plugin","homepage":null,"size":1487,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"matecat:master","ref":"master","sha":"a40354c522407f5b0f4e04ef573b60e5b14eb0f4","user":{"login":"matecat","id":10046475,"avatar_url":"https://avatars3.githubusercontent.com/u/10046475?v=4","gravatar_id":"","url":"https://api.github.com/users/matecat","html_url":"https://github.com/matecat","followers_url":"https://api.github.com/users/matecat/followers","following_url":"https://api.github.com/users/matecat/following{/other_user}","gists_url":"https://api.github.com/users/matecat/gists{/gist_id}","starred_url":"https://api.github.com/users/matecat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matecat/subscriptions","organizations_url":"https://api.github.com/users/matecat/orgs","repos_url":"https://api.github.com/users/matecat/repos","events_url":"https://api.github.com/users/matecat/events{/privacy}","received_events_url":"https://api.github.com/users/matecat/received_events","type":"Organization","site_admin":false},"repo":{"id":104228718,"name":"paypal_plugin","full_name":"matecat/paypal_plugin","owner":{"login":"matecat","id":10046475,"avatar_url":"https://avatars3.githubusercontent.com/u/10046475?v=4","gravatar_id":"","url":"https://api.github.com/users/matecat","html_url":"https://github.com/matecat","followers_url":"https://api.github.com/users/matecat/followers","following_url":"https://api.github.com/users/matecat/following{/other_user}","gists_url":"https://api.github.com/users/matecat/gists{/gist_id}","starred_url":"https://api.github.com/users/matecat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matecat/subscriptions","organizations_url":"https://api.github.com/users/matecat/orgs","repos_url":"https://api.github.com/users/matecat/repos","events_url":"https://api.github.com/users/matecat/events{/privacy}","received_events_url":"https://api.github.com/users/matecat/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matecat/paypal_plugin","description":null,"fork":false,"url":"https://api.github.com/repos/matecat/paypal_plugin","forks_url":"https://api.github.com/repos/matecat/paypal_plugin/forks","keys_url":"https://api.github.com/repos/matecat/paypal_plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matecat/paypal_plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matecat/paypal_plugin/teams","hooks_url":"https://api.github.com/repos/matecat/paypal_plugin/hooks","issue_events_url":"https://api.github.com/repos/matecat/paypal_plugin/issues/events{/number}","events_url":"https://api.github.com/repos/matecat/paypal_plugin/events","assignees_url":"https://api.github.com/repos/matecat/paypal_plugin/assignees{/user}","branches_url":"https://api.github.com/repos/matecat/paypal_plugin/branches{/branch}","tags_url":"https://api.github.com/repos/matecat/paypal_plugin/tags","blobs_url":"https://api.github.com/repos/matecat/paypal_plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matecat/paypal_plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matecat/paypal_plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/matecat/paypal_plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matecat/paypal_plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/matecat/paypal_plugin/languages","stargazers_url":"https://api.github.com/repos/matecat/paypal_plugin/stargazers","contributors_url":"https://api.github.com/repos/matecat/paypal_plugin/contributors","subscribers_url":"https://api.github.com/repos/matecat/paypal_plugin/subscribers","subscription_url":"https://api.github.com/repos/matecat/paypal_plugin/subscription","commits_url":"https://api.github.com/repos/matecat/paypal_plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/matecat/paypal_plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/matecat/paypal_plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/matecat/paypal_plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/matecat/paypal_plugin/contents/{+path}","compare_url":"https://api.github.com/repos/matecat/paypal_plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matecat/paypal_plugin/merges","archive_url":"https://api.github.com/repos/matecat/paypal_plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matecat/paypal_plugin/downloads","issues_url":"https://api.github.com/repos/matecat/paypal_plugin/issues{/number}","pulls_url":"https://api.github.com/repos/matecat/paypal_plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/matecat/paypal_plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/matecat/paypal_plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matecat/paypal_plugin/labels{/name}","releases_url":"https://api.github.com/repos/matecat/paypal_plugin/releases{/id}","deployments_url":"https://api.github.com/repos/matecat/paypal_plugin/deployments","created_at":"2017-09-20T14:48:45Z","updated_at":"2017-09-26T16:25:16Z","pushed_at":"2017-12-12T18:08:00Z","git_url":"git://github.com/matecat/paypal_plugin.git","ssh_url":"git@github.com:matecat/paypal_plugin.git","clone_url":"https://github.com/matecat/paypal_plugin.git","svn_url":"https://github.com/matecat/paypal_plugin","homepage":null,"size":1485,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":4,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matecat/paypal_plugin/pulls/5"},"html":{"href":"https://github.com/matecat/paypal_plugin/pull/5"},"issue":{"href":"https://api.github.com/repos/matecat/paypal_plugin/issues/5"},"comments":{"href":"https://api.github.com/repos/matecat/paypal_plugin/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/matecat/paypal_plugin/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/matecat/paypal_plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matecat/paypal_plugin/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/matecat/paypal_plugin/statuses/9ab4bddcaf2d3b4e2a548005e5e8e1a161171dff"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Ostico"}}