{"action":"created","comment":{"url":"https://api.github.com/repos/DoSomething/rogue/pulls/comments/240746660","pull_request_review_id":183847793,"id":240746660,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MDc0NjY2MA==","diff_hunk":"@@ -27,7 +27,8 @@ public function __construct()\n      */\n     public function viewAll($user, Post $post)\n     {\n-        if ($user === null) {\n+        // If there is no user and it is not a client with admin credentials, return false.\n+        if ($user === null && is_staff_user() === false) {","path":"app/Policies/PostPolicy.php","position":6,"original_position":6,"commit_id":"cb7da2379a7f5c1fd42ab3709ab8191b230d8aa8","original_commit_id":"cb7da2379a7f5c1fd42ab3709ab8191b230d8aa8","user":{"login":"chloealee","id":9019452,"node_id":"MDQ6VXNlcjkwMTk0NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/9019452?v=4","gravatar_id":"","url":"https://api.github.com/users/chloealee","html_url":"https://github.com/chloealee","followers_url":"https://api.github.com/users/chloealee/followers","following_url":"https://api.github.com/users/chloealee/following{/other_user}","gists_url":"https://api.github.com/users/chloealee/gists{/gist_id}","starred_url":"https://api.github.com/users/chloealee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chloealee/subscriptions","organizations_url":"https://api.github.com/users/chloealee/orgs","repos_url":"https://api.github.com/users/chloealee/repos","events_url":"https://api.github.com/users/chloealee/events{/privacy}","received_events_url":"https://api.github.com/users/chloealee/received_events","type":"User","site_admin":false},"body":"@katiecrane great q! I think we want that in case it is an anonymous user.","created_at":"2018-12-11T18:57:03Z","updated_at":"2018-12-11T18:57:03Z","html_url":"https://github.com/DoSomething/rogue/pull/807#discussion_r240746660","pull_request_url":"https://api.github.com/repos/DoSomething/rogue/pulls/807","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/DoSomething/rogue/pulls/comments/240746660"},"html":{"href":"https://github.com/DoSomething/rogue/pull/807#discussion_r240746660"},"pull_request":{"href":"https://api.github.com/repos/DoSomething/rogue/pulls/807"}},"in_reply_to_id":240746437},"pull_request":{"url":"https://api.github.com/repos/DoSomething/rogue/pulls/807","id":237785082,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3Nzg1MDgy","html_url":"https://github.com/DoSomething/rogue/pull/807","diff_url":"https://github.com/DoSomething/rogue/pull/807.diff","patch_url":"https://github.com/DoSomething/rogue/pull/807.patch","issue_url":"https://api.github.com/repos/DoSomething/rogue/issues/807","number":807,"state":"open","locked":false,"title":"Fixes viewAll in PostPolicy to take client credentials into account","user":{"login":"chloealee","id":9019452,"node_id":"MDQ6VXNlcjkwMTk0NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/9019452?v=4","gravatar_id":"","url":"https://api.github.com/users/chloealee","html_url":"https://github.com/chloealee","followers_url":"https://api.github.com/users/chloealee/followers","following_url":"https://api.github.com/users/chloealee/following{/other_user}","gists_url":"https://api.github.com/users/chloealee/gists{/gist_id}","starred_url":"https://api.github.com/users/chloealee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chloealee/subscriptions","organizations_url":"https://api.github.com/users/chloealee/orgs","repos_url":"https://api.github.com/users/chloealee/repos","events_url":"https://api.github.com/users/chloealee/events{/privacy}","received_events_url":"https://api.github.com/users/chloealee/received_events","type":"User","site_admin":false},"body":"#### What's this PR do?\r\nFixes `viewAll` in PostPolicy to take client credentials into account. \r\n  - This was returning `false` if a client with `admin` credentials tried to get the full `post` response and therefore didn't return the following for a client when it should have: \r\n```\r\n$response['tags'] = $post->tagSlugs();\r\n$response['source'] = $post->source;\r\n$response['source_details'] = $post->source_details;\r\n$response['remote_addr'] = '0.0.0.0';\r\n$response['details'] = $post->details;\r\n```\r\n\r\n#### How should this be reviewed?\r\n👀 \r\n\r\n#### Any background context you want to provide?\r\nI thought about updating the Signup Transformer to also use the Gate but it seems like a little much for right now since this would be the only rule and is a little less intuitive then [how it is now](https://github.com/DoSomething/rogue/blob/master/app/Http/Transformers/SignupTransformer.php#L38). If there are more rules in the future, I think we can add a `SignupPolicy` but not sure if it is needed now.\r\n\r\n#### Relevant tickets\r\nFixes [this](https://www.pivotaltracker.com/n/projects/2019429/stories/162548698) Pivotal Card.\r\n\r\ncc @aaronschachter \r\n\r\n#### How to deploy\r\nhttps://github.com/DoSomething/rogue/blob/master/docs/development/deployments.md\r\n","created_at":"2018-12-11T18:37:21Z","updated_at":"2018-12-11T18:57:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"75cf6843ab97915941f196dd78641ae35c469692","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/DoSomething/rogue/pulls/807/commits","review_comments_url":"https://api.github.com/repos/DoSomething/rogue/pulls/807/comments","review_comment_url":"https://api.github.com/repos/DoSomething/rogue/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DoSomething/rogue/issues/807/comments","statuses_url":"https://api.github.com/repos/DoSomething/rogue/statuses/cb7da2379a7f5c1fd42ab3709ab8191b230d8aa8","head":{"label":"DoSomething:test","ref":"test","sha":"cb7da2379a7f5c1fd42ab3709ab8191b230d8aa8","user":{"login":"DoSomething","id":731685,"node_id":"MDEyOk9yZ2FuaXphdGlvbjczMTY4NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"repo":{"id":64166359,"node_id":"MDEwOlJlcG9zaXRvcnk2NDE2NjM1OQ==","name":"rogue","full_name":"DoSomething/rogue","private":false,"owner":{"login":"DoSomething","id":731685,"node_id":"MDEyOk9yZ2FuaXphdGlvbjczMTY4NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/DoSomething/rogue","description":":camera: The DoSomething.org activity service.","fork":false,"url":"https://api.github.com/repos/DoSomething/rogue","forks_url":"https://api.github.com/repos/DoSomething/rogue/forks","keys_url":"https://api.github.com/repos/DoSomething/rogue/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/rogue/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/rogue/teams","hooks_url":"https://api.github.com/repos/DoSomething/rogue/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/rogue/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/rogue/events","assignees_url":"https://api.github.com/repos/DoSomething/rogue/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/rogue/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/rogue/tags","blobs_url":"https://api.github.com/repos/DoSomething/rogue/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/rogue/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/rogue/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/rogue/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/rogue/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/rogue/languages","stargazers_url":"https://api.github.com/repos/DoSomething/rogue/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/rogue/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/rogue/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/rogue/subscription","commits_url":"https://api.github.com/repos/DoSomething/rogue/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/rogue/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/rogue/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/rogue/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/rogue/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/rogue/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/rogue/merges","archive_url":"https://api.github.com/repos/DoSomething/rogue/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/rogue/downloads","issues_url":"https://api.github.com/repos/DoSomething/rogue/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/rogue/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/rogue/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/rogue/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/rogue/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/rogue/releases{/id}","deployments_url":"https://api.github.com/repos/DoSomething/rogue/deployments","created_at":"2016-07-25T20:38:30Z","updated_at":"2018-12-10T21:07:02Z","pushed_at":"2018-12-11T18:52:49Z","git_url":"git://github.com/DoSomething/rogue.git","ssh_url":"git@github.com:DoSomething/rogue.git","clone_url":"https://github.com/DoSomething/rogue.git","svn_url":"https://github.com/DoSomething/rogue","homepage":"https://activity.dosomething.org","size":7370,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":5,"open_issues":8,"watchers":0,"default_branch":"master"}},"base":{"label":"DoSomething:master","ref":"master","sha":"05c63a362c814eb578f67d3e5d926b3b6100c433","user":{"login":"DoSomething","id":731685,"node_id":"MDEyOk9yZ2FuaXphdGlvbjczMTY4NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"repo":{"id":64166359,"node_id":"MDEwOlJlcG9zaXRvcnk2NDE2NjM1OQ==","name":"rogue","full_name":"DoSomething/rogue","private":false,"owner":{"login":"DoSomething","id":731685,"node_id":"MDEyOk9yZ2FuaXphdGlvbjczMTY4NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/731685?v=4","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/DoSomething/rogue","description":":camera: The DoSomething.org activity service.","fork":false,"url":"https://api.github.com/repos/DoSomething/rogue","forks_url":"https://api.github.com/repos/DoSomething/rogue/forks","keys_url":"https://api.github.com/repos/DoSomething/rogue/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/rogue/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/rogue/teams","hooks_url":"https://api.github.com/repos/DoSomething/rogue/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/rogue/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/rogue/events","assignees_url":"https://api.github.com/repos/DoSomething/rogue/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/rogue/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/rogue/tags","blobs_url":"https://api.github.com/repos/DoSomething/rogue/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/rogue/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/rogue/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/rogue/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/rogue/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/rogue/languages","stargazers_url":"https://api.github.com/repos/DoSomething/rogue/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/rogue/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/rogue/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/rogue/subscription","commits_url":"https://api.github.com/repos/DoSomething/rogue/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/rogue/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/rogue/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/rogue/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/rogue/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/rogue/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/rogue/merges","archive_url":"https://api.github.com/repos/DoSomething/rogue/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/rogue/downloads","issues_url":"https://api.github.com/repos/DoSomething/rogue/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/rogue/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/rogue/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/rogue/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/rogue/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/rogue/releases{/id}","deployments_url":"https://api.github.com/repos/DoSomething/rogue/deployments","created_at":"2016-07-25T20:38:30Z","updated_at":"2018-12-10T21:07:02Z","pushed_at":"2018-12-11T18:52:49Z","git_url":"git://github.com/DoSomething/rogue.git","ssh_url":"git@github.com:DoSomething/rogue.git","clone_url":"https://github.com/DoSomething/rogue.git","svn_url":"https://github.com/DoSomething/rogue","homepage":"https://activity.dosomething.org","size":7370,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":5,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DoSomething/rogue/pulls/807"},"html":{"href":"https://github.com/DoSomething/rogue/pull/807"},"issue":{"href":"https://api.github.com/repos/DoSomething/rogue/issues/807"},"comments":{"href":"https://api.github.com/repos/DoSomething/rogue/issues/807/comments"},"review_comments":{"href":"https://api.github.com/repos/DoSomething/rogue/pulls/807/comments"},"review_comment":{"href":"https://api.github.com/repos/DoSomething/rogue/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DoSomething/rogue/pulls/807/commits"},"statuses":{"href":"https://api.github.com/repos/DoSomething/rogue/statuses/cb7da2379a7f5c1fd42ab3709ab8191b230d8aa8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"chloealee"}}