{"action":"created","comment":{"url":"https://api.github.com/repos/kbase/KBaseSearchEngine/pulls/comments/202219942","pull_request_review_id":136877999,"id":202219942,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjIxOTk0Mg==","diff_hunk":"@@ -669,4 +673,58 @@ private void compare(final SortingRule got, final SortingRule expected) {\n                 is(expected.getIsObjectProperty() == null ? 1L : expected.getIsObjectProperty()));\n     }\n \n+    @Test\n+    public void testAccessFilter() throws Exception{\n+        final AccessGroupProvider agp = mock(AccessGroupProvider.class);\n+        final IndexingStorage is = mock(IndexingStorage.class);\n+        final TypeStorage ts = mock(TypeStorage.class);\n+\n+        final Set<String> admins = new HashSet<>(Arrays.asList(\"auser\"));\n+        final SearchInterface sm = new SearchMethods(agp, is, ts, admins);\n+\n+        final List<Integer> adminList = new ArrayList<>();\n+        adminList.add(2);\n+        final Map<String, Integer> exMap = new HashMap<>();\n+        exMap.put(\"test\", 1);\n+\n+        when(agp.findAccessGroupIds(\"auser\"))\n+                .thenReturn(adminList);\n+        kbasesearchengine.search.AccessFilter test  = new kbasesearchengine.search.AccessFilter()\n+                .withAccessGroups(new LinkedHashSet(adminList));\n+\n+        //return data is user right access group id\n+        when(is.searchTypes( kbasesearchengine.search.MatchFilter.getBuilder().build(),\n+                new kbasesearchengine.search.AccessFilter()\n+                        .withAccessGroups(new LinkedHashSet(adminList))\n+                        .withAdmin(true)))\n+        .thenReturn(exMap);\n+\n+\n+        //expected private results: SearchMethods changes integer results to longs\n+        final Map<String, Long> expectedRes = new HashMap<>();\n+        expectedRes.put(\"test\", 1L);\n+\n+        final SearchTypesInput input1 = new SearchTypesInput()\n+                .withAccessFilter(new AccessFilter().withWithPrivate(1L))\n+                .withMatchFilter(new MatchFilter());\n+\n+        //authorized and showing private data\n+        final SearchTypesOutput res = sm.searchTypes(input1,\n+                \"auser\");\n+\n+        assertThat(\"incorrect res\", res.getTypeToCount(), is(expectedRes));\n+\n+        //unauthorized user","path":"test/src/kbasesearchengine/test/main/SearchMethodsTest.java","position":60,"original_position":60,"commit_id":"1bff3924700edd5dce226e416cb9ad17c6ab93e6","original_commit_id":"1bff3924700edd5dce226e416cb9ad17c6ab93e6","user":{"login":"MrCreosote","id":1686141,"node_id":"MDQ6VXNlcjE2ODYxNDE=","avatar_url":"https://avatars1.githubusercontent.com/u/1686141?v=4","gravatar_id":"","url":"https://api.github.com/users/MrCreosote","html_url":"https://github.com/MrCreosote","followers_url":"https://api.github.com/users/MrCreosote/followers","following_url":"https://api.github.com/users/MrCreosote/following{/other_user}","gists_url":"https://api.github.com/users/MrCreosote/gists{/gist_id}","starred_url":"https://api.github.com/users/MrCreosote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrCreosote/subscriptions","organizations_url":"https://api.github.com/users/MrCreosote/orgs","repos_url":"https://api.github.com/users/MrCreosote/repos","events_url":"https://api.github.com/users/MrCreosote/events{/privacy}","received_events_url":"https://api.github.com/users/MrCreosote/received_events","type":"User","site_admin":false},"body":"public did change: https://github.com/kbase/KBaseSearchEngine/pull/260/files#diff-f58b37782d687c1180cb73e938fcec71R127","created_at":"2018-07-13T00:59:19Z","updated_at":"2018-07-13T00:59:19Z","html_url":"https://github.com/kbase/KBaseSearchEngine/pull/260#discussion_r202219942","pull_request_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/pulls/260","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/kbase/KBaseSearchEngine/pulls/comments/202219942"},"html":{"href":"https://github.com/kbase/KBaseSearchEngine/pull/260#discussion_r202219942"},"pull_request":{"href":"https://api.github.com/repos/kbase/KBaseSearchEngine/pulls/260"}},"in_reply_to_id":202203047},"pull_request":{"url":"https://api.github.com/repos/kbase/KBaseSearchEngine/pulls/260","id":199096705,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5MDk2NzA1","html_url":"https://github.com/kbase/KBaseSearchEngine/pull/260","diff_url":"https://github.com/kbase/KBaseSearchEngine/pull/260.diff","patch_url":"https://github.com/kbase/KBaseSearchEngine/pull/260.patch","issue_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/issues/260","number":260,"state":"open","locked":false,"title":"New720","user":{"login":"tiramisu24","id":13957313,"node_id":"MDQ6VXNlcjEzOTU3MzEz","avatar_url":"https://avatars2.githubusercontent.com/u/13957313?v=4","gravatar_id":"","url":"https://api.github.com/users/tiramisu24","html_url":"https://github.com/tiramisu24","followers_url":"https://api.github.com/users/tiramisu24/followers","following_url":"https://api.github.com/users/tiramisu24/following{/other_user}","gists_url":"https://api.github.com/users/tiramisu24/gists{/gist_id}","starred_url":"https://api.github.com/users/tiramisu24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiramisu24/subscriptions","organizations_url":"https://api.github.com/users/tiramisu24/orgs","repos_url":"https://api.github.com/users/tiramisu24/repos","events_url":"https://api.github.com/users/tiramisu24/events{/privacy}","received_events_url":"https://api.github.com/users/tiramisu24/received_events","type":"User","site_admin":false},"body":"-cleanup\r\n- fixed test in SearchAPIIntegrationTest","created_at":"2018-07-03T22:18:44Z","updated_at":"2018-07-13T00:59:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6121e1edc99742002df468bc11d835f6fc204026","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/pulls/260/commits","review_comments_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/pulls/260/comments","review_comment_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/issues/260/comments","statuses_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/statuses/1bff3924700edd5dce226e416cb9ad17c6ab93e6","head":{"label":"tiramisu24:new720","ref":"new720","sha":"1bff3924700edd5dce226e416cb9ad17c6ab93e6","user":{"login":"tiramisu24","id":13957313,"node_id":"MDQ6VXNlcjEzOTU3MzEz","avatar_url":"https://avatars2.githubusercontent.com/u/13957313?v=4","gravatar_id":"","url":"https://api.github.com/users/tiramisu24","html_url":"https://github.com/tiramisu24","followers_url":"https://api.github.com/users/tiramisu24/followers","following_url":"https://api.github.com/users/tiramisu24/following{/other_user}","gists_url":"https://api.github.com/users/tiramisu24/gists{/gist_id}","starred_url":"https://api.github.com/users/tiramisu24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiramisu24/subscriptions","organizations_url":"https://api.github.com/users/tiramisu24/orgs","repos_url":"https://api.github.com/users/tiramisu24/repos","events_url":"https://api.github.com/users/tiramisu24/events{/privacy}","received_events_url":"https://api.github.com/users/tiramisu24/received_events","type":"User","site_admin":false},"repo":{"id":111612521,"node_id":"MDEwOlJlcG9zaXRvcnkxMTE2MTI1MjE=","name":"KBaseSearchEngine","full_name":"tiramisu24/KBaseSearchEngine","owner":{"login":"tiramisu24","id":13957313,"node_id":"MDQ6VXNlcjEzOTU3MzEz","avatar_url":"https://avatars2.githubusercontent.com/u/13957313?v=4","gravatar_id":"","url":"https://api.github.com/users/tiramisu24","html_url":"https://github.com/tiramisu24","followers_url":"https://api.github.com/users/tiramisu24/followers","following_url":"https://api.github.com/users/tiramisu24/following{/other_user}","gists_url":"https://api.github.com/users/tiramisu24/gists{/gist_id}","starred_url":"https://api.github.com/users/tiramisu24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiramisu24/subscriptions","organizations_url":"https://api.github.com/users/tiramisu24/orgs","repos_url":"https://api.github.com/users/tiramisu24/repos","events_url":"https://api.github.com/users/tiramisu24/events{/privacy}","received_events_url":"https://api.github.com/users/tiramisu24/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tiramisu24/KBaseSearchEngine","description":null,"fork":true,"url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine","forks_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/forks","keys_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/teams","hooks_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/hooks","issue_events_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/issues/events{/number}","events_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/events","assignees_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/assignees{/user}","branches_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/branches{/branch}","tags_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/tags","blobs_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/git/refs{/sha}","trees_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/statuses/{sha}","languages_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/languages","stargazers_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/stargazers","contributors_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/contributors","subscribers_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/subscribers","subscription_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/subscription","commits_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/commits{/sha}","git_commits_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/git/commits{/sha}","comments_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/comments{/number}","issue_comment_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/issues/comments{/number}","contents_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/contents/{+path}","compare_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/merges","archive_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/downloads","issues_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/issues{/number}","pulls_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/pulls{/number}","milestones_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/milestones{/number}","notifications_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/labels{/name}","releases_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/releases{/id}","deployments_url":"https://api.github.com/repos/tiramisu24/KBaseSearchEngine/deployments","created_at":"2017-11-21T23:20:21Z","updated_at":"2018-07-02T17:25:47Z","pushed_at":"2018-07-12T17:59:43Z","git_url":"git://github.com/tiramisu24/KBaseSearchEngine.git","ssh_url":"git@github.com:tiramisu24/KBaseSearchEngine.git","clone_url":"https://github.com/tiramisu24/KBaseSearchEngine.git","svn_url":"https://github.com/tiramisu24/KBaseSearchEngine","homepage":null,"size":7324,"stargazers_count":0,"watchers_count":0,"language":"Java","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":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kbase:develop","ref":"develop","sha":"dc968d34d0d4cad5652786c97552a3ebe30b72cd","user":{"login":"kbase","id":1263946,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNjM5NDY=","avatar_url":"https://avatars2.githubusercontent.com/u/1263946?v=4","gravatar_id":"","url":"https://api.github.com/users/kbase","html_url":"https://github.com/kbase","followers_url":"https://api.github.com/users/kbase/followers","following_url":"https://api.github.com/users/kbase/following{/other_user}","gists_url":"https://api.github.com/users/kbase/gists{/gist_id}","starred_url":"https://api.github.com/users/kbase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbase/subscriptions","organizations_url":"https://api.github.com/users/kbase/orgs","repos_url":"https://api.github.com/users/kbase/repos","events_url":"https://api.github.com/users/kbase/events{/privacy}","received_events_url":"https://api.github.com/users/kbase/received_events","type":"Organization","site_admin":false},"repo":{"id":87230036,"node_id":"MDEwOlJlcG9zaXRvcnk4NzIzMDAzNg==","name":"KBaseSearchEngine","full_name":"kbase/KBaseSearchEngine","owner":{"login":"kbase","id":1263946,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNjM5NDY=","avatar_url":"https://avatars2.githubusercontent.com/u/1263946?v=4","gravatar_id":"","url":"https://api.github.com/users/kbase","html_url":"https://github.com/kbase","followers_url":"https://api.github.com/users/kbase/followers","following_url":"https://api.github.com/users/kbase/following{/other_user}","gists_url":"https://api.github.com/users/kbase/gists{/gist_id}","starred_url":"https://api.github.com/users/kbase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbase/subscriptions","organizations_url":"https://api.github.com/users/kbase/orgs","repos_url":"https://api.github.com/users/kbase/repos","events_url":"https://api.github.com/users/kbase/events{/privacy}","received_events_url":"https://api.github.com/users/kbase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kbase/KBaseSearchEngine","description":null,"fork":false,"url":"https://api.github.com/repos/kbase/KBaseSearchEngine","forks_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/forks","keys_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/teams","hooks_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/hooks","issue_events_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/issues/events{/number}","events_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/events","assignees_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/assignees{/user}","branches_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/branches{/branch}","tags_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/tags","blobs_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/git/refs{/sha}","trees_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/statuses/{sha}","languages_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/languages","stargazers_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/stargazers","contributors_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/contributors","subscribers_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/subscribers","subscription_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/subscription","commits_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/commits{/sha}","git_commits_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/git/commits{/sha}","comments_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/comments{/number}","issue_comment_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/issues/comments{/number}","contents_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/contents/{+path}","compare_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/merges","archive_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/downloads","issues_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/issues{/number}","pulls_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/pulls{/number}","milestones_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/milestones{/number}","notifications_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/labels{/name}","releases_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/releases{/id}","deployments_url":"https://api.github.com/repos/kbase/KBaseSearchEngine/deployments","created_at":"2017-04-04T20:07:10Z","updated_at":"2018-06-08T21:27:46Z","pushed_at":"2018-07-12T17:59:45Z","git_url":"git://github.com/kbase/KBaseSearchEngine.git","ssh_url":"git@github.com:kbase/KBaseSearchEngine.git","clone_url":"https://github.com/kbase/KBaseSearchEngine.git","svn_url":"https://github.com/kbase/KBaseSearchEngine","homepage":null,"size":6805,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":9,"open_issues":7,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kbase/KBaseSearchEngine/pulls/260"},"html":{"href":"https://github.com/kbase/KBaseSearchEngine/pull/260"},"issue":{"href":"https://api.github.com/repos/kbase/KBaseSearchEngine/issues/260"},"comments":{"href":"https://api.github.com/repos/kbase/KBaseSearchEngine/issues/260/comments"},"review_comments":{"href":"https://api.github.com/repos/kbase/KBaseSearchEngine/pulls/260/comments"},"review_comment":{"href":"https://api.github.com/repos/kbase/KBaseSearchEngine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kbase/KBaseSearchEngine/pulls/260/commits"},"statuses":{"href":"https://api.github.com/repos/kbase/KBaseSearchEngine/statuses/1bff3924700edd5dce226e416cb9ad17c6ab93e6"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"MrCreosote"}}