{"action":"created","comment":{"url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/comments/55761650","id":55761650,"diff_hunk":"@@ -237,7 +256,7 @@ def get_feed_internal\n         isDelegateUser: is_delegate_user?,\n         showSisProfileUI: is_sis_profile_visible?\n       }\n-      feed[:delegateViewAsPrivileges] = delegate_view_as_privileges if delegate_view_as_privileges\n+      filter_user_api_for_delegator(feed, delegate_view_as_privileges) if authentication_state.authenticated_as_delegate?","path":"app/models/user/api.rb","position":89,"original_position":89,"commit_id":"fd273b0c979a110656d7998c332733bfa2ca8b5b","original_commit_id":"fd273b0c979a110656d7998c332733bfa2ca8b5b","user":{"login":"johncrossman","id":7606442,"avatar_url":"https://avatars.githubusercontent.com/u/7606442?v=3","gravatar_id":"","url":"https://api.github.com/users/johncrossman","html_url":"https://github.com/johncrossman","followers_url":"https://api.github.com/users/johncrossman/followers","following_url":"https://api.github.com/users/johncrossman/following{/other_user}","gists_url":"https://api.github.com/users/johncrossman/gists{/gist_id}","starred_url":"https://api.github.com/users/johncrossman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johncrossman/subscriptions","organizations_url":"https://api.github.com/users/johncrossman/orgs","repos_url":"https://api.github.com/users/johncrossman/repos","events_url":"https://api.github.com/users/johncrossman/events{/privacy}","received_events_url":"https://api.github.com/users/johncrossman/received_events","type":"User","site_admin":false},"body":"This all looks really good, @raydavis  One question: how about moving the call to `get_delegate_view_as_privileges` into your newly added `filter_user_api_for_delegator` method? I.e., fully encapsulate the filter logic. This means removing delegated-access logic from `has_academics_tab?` and then adding to filter_user_api_for_delegator:\r\n```\r\nview_as_privileges = get_delegate_view_as_privileges\r\nhasAcademicsTab: feed[:hasAcademicsTab] && (view_as_privileges[:viewEnrollments] || view_as_privileges[:viewGrades])\r\n```\r\nI like how your changes improve readability. This might be one more step in that direction.\r\n","created_at":"2016-03-10T22:34:21Z","updated_at":"2016-03-10T22:34:21Z","html_url":"https://github.com/ets-berkeley-edu/calcentral/pull/5049#discussion_r55761650","pull_request_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/5049","_links":{"self":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/comments/55761650"},"html":{"href":"https://github.com/ets-berkeley-edu/calcentral/pull/5049#discussion_r55761650"},"pull_request":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/5049"}}},"pull_request":{"url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/5049","id":62451121,"html_url":"https://github.com/ets-berkeley-edu/calcentral/pull/5049","diff_url":"https://github.com/ets-berkeley-edu/calcentral/pull/5049.diff","patch_url":"https://github.com/ets-berkeley-edu/calcentral/pull/5049.patch","issue_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/issues/5049","number":5049,"state":"open","locked":false,"title":"SISRP-16046 Fix expiration of View-As caches","user":{"login":"raydavis","id":98528,"avatar_url":"https://avatars.githubusercontent.com/u/98528?v=3","gravatar_id":"","url":"https://api.github.com/users/raydavis","html_url":"https://github.com/raydavis","followers_url":"https://api.github.com/users/raydavis/followers","following_url":"https://api.github.com/users/raydavis/following{/other_user}","gists_url":"https://api.github.com/users/raydavis/gists{/gist_id}","starred_url":"https://api.github.com/users/raydavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raydavis/subscriptions","organizations_url":"https://api.github.com/users/raydavis/orgs","repos_url":"https://api.github.com/users/raydavis/repos","events_url":"https://api.github.com/users/raydavis/events{/privacy}","received_events_url":"https://api.github.com/users/raydavis/received_events","type":"User","site_admin":false},"body":"https://jira.berkeley.edu/browse/SISRP-16046\r\n\r\nThis is a stopgap to fix some critical QA issues. I will follow up with JIRAs to:\r\n* Clean up and consolidate the many flavors of feed filtering.\r\n* Check for redundant Photo caching.\r\n","created_at":"2016-03-10T20:31:25Z","updated_at":"2016-03-10T22:34:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ded31e47008743d46a86e26f0e625a299602654","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/5049/commits","review_comments_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/5049/comments","review_comment_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/issues/5049/comments","statuses_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/statuses/fd273b0c979a110656d7998c332733bfa2ca8b5b","head":{"label":"raydavis:filters","ref":"filters","sha":"fd273b0c979a110656d7998c332733bfa2ca8b5b","user":{"login":"raydavis","id":98528,"avatar_url":"https://avatars.githubusercontent.com/u/98528?v=3","gravatar_id":"","url":"https://api.github.com/users/raydavis","html_url":"https://github.com/raydavis","followers_url":"https://api.github.com/users/raydavis/followers","following_url":"https://api.github.com/users/raydavis/following{/other_user}","gists_url":"https://api.github.com/users/raydavis/gists{/gist_id}","starred_url":"https://api.github.com/users/raydavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raydavis/subscriptions","organizations_url":"https://api.github.com/users/raydavis/orgs","repos_url":"https://api.github.com/users/raydavis/repos","events_url":"https://api.github.com/users/raydavis/events{/privacy}","received_events_url":"https://api.github.com/users/raydavis/received_events","type":"User","site_admin":false},"repo":{"id":5498125,"name":"calcentral","full_name":"raydavis/calcentral","owner":{"login":"raydavis","id":98528,"avatar_url":"https://avatars.githubusercontent.com/u/98528?v=3","gravatar_id":"","url":"https://api.github.com/users/raydavis","html_url":"https://github.com/raydavis","followers_url":"https://api.github.com/users/raydavis/followers","following_url":"https://api.github.com/users/raydavis/following{/other_user}","gists_url":"https://api.github.com/users/raydavis/gists{/gist_id}","starred_url":"https://api.github.com/users/raydavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raydavis/subscriptions","organizations_url":"https://api.github.com/users/raydavis/orgs","repos_url":"https://api.github.com/users/raydavis/repos","events_url":"https://api.github.com/users/raydavis/events{/privacy}","received_events_url":"https://api.github.com/users/raydavis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/raydavis/calcentral","description":"","fork":true,"url":"https://api.github.com/repos/raydavis/calcentral","forks_url":"https://api.github.com/repos/raydavis/calcentral/forks","keys_url":"https://api.github.com/repos/raydavis/calcentral/keys{/key_id}","collaborators_url":"https://api.github.com/repos/raydavis/calcentral/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/raydavis/calcentral/teams","hooks_url":"https://api.github.com/repos/raydavis/calcentral/hooks","issue_events_url":"https://api.github.com/repos/raydavis/calcentral/issues/events{/number}","events_url":"https://api.github.com/repos/raydavis/calcentral/events","assignees_url":"https://api.github.com/repos/raydavis/calcentral/assignees{/user}","branches_url":"https://api.github.com/repos/raydavis/calcentral/branches{/branch}","tags_url":"https://api.github.com/repos/raydavis/calcentral/tags","blobs_url":"https://api.github.com/repos/raydavis/calcentral/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/raydavis/calcentral/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/raydavis/calcentral/git/refs{/sha}","trees_url":"https://api.github.com/repos/raydavis/calcentral/git/trees{/sha}","statuses_url":"https://api.github.com/repos/raydavis/calcentral/statuses/{sha}","languages_url":"https://api.github.com/repos/raydavis/calcentral/languages","stargazers_url":"https://api.github.com/repos/raydavis/calcentral/stargazers","contributors_url":"https://api.github.com/repos/raydavis/calcentral/contributors","subscribers_url":"https://api.github.com/repos/raydavis/calcentral/subscribers","subscription_url":"https://api.github.com/repos/raydavis/calcentral/subscription","commits_url":"https://api.github.com/repos/raydavis/calcentral/commits{/sha}","git_commits_url":"https://api.github.com/repos/raydavis/calcentral/git/commits{/sha}","comments_url":"https://api.github.com/repos/raydavis/calcentral/comments{/number}","issue_comment_url":"https://api.github.com/repos/raydavis/calcentral/issues/comments{/number}","contents_url":"https://api.github.com/repos/raydavis/calcentral/contents/{+path}","compare_url":"https://api.github.com/repos/raydavis/calcentral/compare/{base}...{head}","merges_url":"https://api.github.com/repos/raydavis/calcentral/merges","archive_url":"https://api.github.com/repos/raydavis/calcentral/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/raydavis/calcentral/downloads","issues_url":"https://api.github.com/repos/raydavis/calcentral/issues{/number}","pulls_url":"https://api.github.com/repos/raydavis/calcentral/pulls{/number}","milestones_url":"https://api.github.com/repos/raydavis/calcentral/milestones{/number}","notifications_url":"https://api.github.com/repos/raydavis/calcentral/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/raydavis/calcentral/labels{/name}","releases_url":"https://api.github.com/repos/raydavis/calcentral/releases{/id}","deployments_url":"https://api.github.com/repos/raydavis/calcentral/deployments","created_at":"2012-08-21T17:00:20Z","updated_at":"2015-05-08T17:55:33Z","pushed_at":"2016-03-10T20:38:40Z","git_url":"git://github.com/raydavis/calcentral.git","ssh_url":"git@github.com:raydavis/calcentral.git","clone_url":"https://github.com/raydavis/calcentral.git","svn_url":"https://github.com/raydavis/calcentral","homepage":null,"size":20182,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"raywip"}},"base":{"label":"ets-berkeley-edu:master","ref":"master","sha":"ce13cb44303f02e2a039245445378d95febfdafe","user":{"login":"ets-berkeley-edu","id":283538,"avatar_url":"https://avatars.githubusercontent.com/u/283538?v=3","gravatar_id":"","url":"https://api.github.com/users/ets-berkeley-edu","html_url":"https://github.com/ets-berkeley-edu","followers_url":"https://api.github.com/users/ets-berkeley-edu/followers","following_url":"https://api.github.com/users/ets-berkeley-edu/following{/other_user}","gists_url":"https://api.github.com/users/ets-berkeley-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/ets-berkeley-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ets-berkeley-edu/subscriptions","organizations_url":"https://api.github.com/users/ets-berkeley-edu/orgs","repos_url":"https://api.github.com/users/ets-berkeley-edu/repos","events_url":"https://api.github.com/users/ets-berkeley-edu/events{/privacy}","received_events_url":"https://api.github.com/users/ets-berkeley-edu/received_events","type":"Organization","site_admin":false},"repo":{"id":5483921,"name":"calcentral","full_name":"ets-berkeley-edu/calcentral","owner":{"login":"ets-berkeley-edu","id":283538,"avatar_url":"https://avatars.githubusercontent.com/u/283538?v=3","gravatar_id":"","url":"https://api.github.com/users/ets-berkeley-edu","html_url":"https://github.com/ets-berkeley-edu","followers_url":"https://api.github.com/users/ets-berkeley-edu/followers","following_url":"https://api.github.com/users/ets-berkeley-edu/following{/other_user}","gists_url":"https://api.github.com/users/ets-berkeley-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/ets-berkeley-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ets-berkeley-edu/subscriptions","organizations_url":"https://api.github.com/users/ets-berkeley-edu/orgs","repos_url":"https://api.github.com/users/ets-berkeley-edu/repos","events_url":"https://api.github.com/users/ets-berkeley-edu/events{/privacy}","received_events_url":"https://api.github.com/users/ets-berkeley-edu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ets-berkeley-edu/calcentral","description":"","fork":false,"url":"https://api.github.com/repos/ets-berkeley-edu/calcentral","forks_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/forks","keys_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/teams","hooks_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/hooks","issue_events_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/issues/events{/number}","events_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/events","assignees_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/assignees{/user}","branches_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/branches{/branch}","tags_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/tags","blobs_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/git/refs{/sha}","trees_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/statuses/{sha}","languages_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/languages","stargazers_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/stargazers","contributors_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/contributors","subscribers_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/subscribers","subscription_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/subscription","commits_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/commits{/sha}","git_commits_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/git/commits{/sha}","comments_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/comments{/number}","issue_comment_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/issues/comments{/number}","contents_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/contents/{+path}","compare_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/merges","archive_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/downloads","issues_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/issues{/number}","pulls_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls{/number}","milestones_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/milestones{/number}","notifications_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/labels{/name}","releases_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/releases{/id}","deployments_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/deployments","created_at":"2012-08-20T16:45:39Z","updated_at":"2016-01-20T21:04:36Z","pushed_at":"2016-03-10T21:40:28Z","git_url":"git://github.com/ets-berkeley-edu/calcentral.git","ssh_url":"git@github.com:ets-berkeley-edu/calcentral.git","clone_url":"https://github.com/ets-berkeley-edu/calcentral.git","svn_url":"https://github.com/ets-berkeley-edu/calcentral","homepage":"https://calcentral.berkeley.edu","size":26818,"stargazers_count":55,"watchers_count":55,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":59,"mirror_url":null,"open_issues_count":2,"forks":59,"open_issues":2,"watchers":55,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/5049"},"html":{"href":"https://github.com/ets-berkeley-edu/calcentral/pull/5049"},"issue":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/issues/5049"},"comments":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/issues/5049/comments"},"review_comments":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/5049/comments"},"review_comment":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/5049/commits"},"statuses":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/statuses/fd273b0c979a110656d7998c332733bfa2ca8b5b"}}}}