{"action":"created","comment":{"url":"https://api.github.com/repos/Jasig/uPortal/pulls/comments/33059705","id":33059705,"diff_hunk":"@@ -131,78 +129,124 @@ public void setAuthorizationService(IAuthorizationService authorizationService)\n     }\n \n     /**\n-     * \n-     * @param request\n-     * @param type\n-     * @return\n+     * Original, pre-4.3 version of this API.  Always returns the entire contents\n+     * of the Portlet Registry, including uncategorized portlets,  to which the\n+     * user has access.  Access is based on the SUBSCRIBE permission.\n      */\n-    @RequestMapping(method = RequestMethod.GET)\n-    public ModelAndView listChannels(WebRequest webRequest, HttpServletRequest request, @RequestParam(value=\"type\",required=false) String type) {\n+    @RequestMapping(value=\"/portletList\", method=RequestMethod.GET)\n+    public ModelAndView listChannels(WebRequest webRequest, HttpServletRequest request,\n+            @RequestParam(value=\"type\",required=false) String type) {\n+\n         if(type != null && TYPE_MANAGE.equals(type)) {\n             throw new UnsupportedOperationException(\"Moved to PortletRESTController under /api/portlets.json\");\n         }\n-        IPerson user = personManager.getPerson(request);\n \n-        Map<String,SortedSet<?>> registry = getRegistry(webRequest, user);\n+        final IPerson user = personManager.getPerson(request);\n+        final PortletCategory rootCategory = portletCategoryRegistry.getTopLevelPortletCategory();\n+        final Map<String,SortedSet<?>> registry = getRegistry(webRequest, user, rootCategory, true);\n+\n+        // Since type=manage was deprecated channels is always empty but retained for backwards compatibility\n+        registry.put(\"channels\", new TreeSet<ChannelBean>());\n \n         return new ModelAndView(\"jsonView\", \"registry\", registry);\n     }\n \n-    private Map<String,SortedSet<?>> getRegistry(WebRequest request, IPerson user) {\n+    /**\n+     * Updated version of this API.  Supports an optional 'categoryId' parameter.\n+     * If provided, this URL will return the portlet registry beginning with the\n+     * specified category, including all descendants, and <em>excluding</em>\n+     * uncategorized portlets.  If no 'categoryId' is provided, this method\n+     * returns the portlet registry beginning with 'All Categories' (the root)\n+     * and <em>including</em> uncategorized portlets.  Access is based on the\n+     * SUBSCRIBE permission.","path":"uportal-war/src/main/java/org/jasig/portal/layout/dlm/remoting/ChannelListController.java","position":58,"original_position":58,"commit_id":"11cc662b4094bd918271b905f64fbc8eaac1ba1a","original_commit_id":"11cc662b4094bd918271b905f64fbc8eaac1ba1a","user":{"login":"apetro","id":952283,"avatar_url":"https://avatars.githubusercontent.com/u/952283?v=3","gravatar_id":"","url":"https://api.github.com/users/apetro","html_url":"https://github.com/apetro","followers_url":"https://api.github.com/users/apetro/followers","following_url":"https://api.github.com/users/apetro/following{/other_user}","gists_url":"https://api.github.com/users/apetro/gists{/gist_id}","starred_url":"https://api.github.com/users/apetro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apetro/subscriptions","organizations_url":"https://api.github.com/users/apetro/orgs","repos_url":"https://api.github.com/users/apetro/repos","events_url":"https://api.github.com/users/apetro/events{/privacy}","received_events_url":"https://api.github.com/users/apetro/received_events","type":"User","site_admin":false},"body":"Probably worth explicitly calling out here that if no `categoryId` is provided, portlets that the user has `BROWSE` on are represented in the response of this web service as if they were un-categorized portlets that the user does have `SUBSCRIBE` on even if the user does not actually have `SUBSCRIBE` on them.  That is, `Access is based on the SUBSCRIBE permission.` isn't the whole story.","created_at":"2015-06-23T16:14:11Z","updated_at":"2015-06-23T16:14:11Z","html_url":"https://github.com/Jasig/uPortal/pull/561#discussion_r33059705","pull_request_url":"https://api.github.com/repos/Jasig/uPortal/pulls/561","_links":{"self":{"href":"https://api.github.com/repos/Jasig/uPortal/pulls/comments/33059705"},"html":{"href":"https://github.com/Jasig/uPortal/pull/561#discussion_r33059705"},"pull_request":{"href":"https://api.github.com/repos/Jasig/uPortal/pulls/561"}}},"pull_request":{"url":"https://api.github.com/repos/Jasig/uPortal/pulls/561","id":38156739,"html_url":"https://github.com/Jasig/uPortal/pull/561","diff_url":"https://github.com/Jasig/uPortal/pull/561.diff","patch_url":"https://github.com/Jasig/uPortal/pull/561.patch","issue_url":"https://api.github.com/repos/Jasig/uPortal/issues/561","number":561,"state":"closed","locked":false,"title":"UP-4497:  Rev the version of the /portletList REST API and add an opt…","user":{"login":"drewwills","id":1127174,"avatar_url":"https://avatars.githubusercontent.com/u/1127174?v=3","gravatar_id":"","url":"https://api.github.com/users/drewwills","html_url":"https://github.com/drewwills","followers_url":"https://api.github.com/users/drewwills/followers","following_url":"https://api.github.com/users/drewwills/following{/other_user}","gists_url":"https://api.github.com/users/drewwills/gists{/gist_id}","starred_url":"https://api.github.com/users/drewwills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewwills/subscriptions","organizations_url":"https://api.github.com/users/drewwills/orgs","repos_url":"https://api.github.com/users/drewwills/repos","events_url":"https://api.github.com/users/drewwills/events{/privacy}","received_events_url":"https://api.github.com/users/drewwills/received_events","type":"User","site_admin":false},"body":"…ional 'categoryId' parameter\r\n\r\nhttps://issues.jasig.org/browse/UP-4497","created_at":"2015-06-19T23:27:08Z","updated_at":"2015-06-23T16:14:11Z","closed_at":"2015-06-22T23:45:03Z","merged_at":"2015-06-22T23:45:03Z","merge_commit_sha":"9ba4651b1cc0d31f6a2f5eb27b74d306b10e0bb5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Jasig/uPortal/pulls/561/commits","review_comments_url":"https://api.github.com/repos/Jasig/uPortal/pulls/561/comments","review_comment_url":"https://api.github.com/repos/Jasig/uPortal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Jasig/uPortal/issues/561/comments","statuses_url":"https://api.github.com/repos/Jasig/uPortal/statuses/11cc662b4094bd918271b905f64fbc8eaac1ba1a","head":{"label":"drewwills:UP-4497","ref":"UP-4497","sha":"11cc662b4094bd918271b905f64fbc8eaac1ba1a","user":{"login":"drewwills","id":1127174,"avatar_url":"https://avatars.githubusercontent.com/u/1127174?v=3","gravatar_id":"","url":"https://api.github.com/users/drewwills","html_url":"https://github.com/drewwills","followers_url":"https://api.github.com/users/drewwills/followers","following_url":"https://api.github.com/users/drewwills/following{/other_user}","gists_url":"https://api.github.com/users/drewwills/gists{/gist_id}","starred_url":"https://api.github.com/users/drewwills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewwills/subscriptions","organizations_url":"https://api.github.com/users/drewwills/orgs","repos_url":"https://api.github.com/users/drewwills/repos","events_url":"https://api.github.com/users/drewwills/events{/privacy}","received_events_url":"https://api.github.com/users/drewwills/received_events","type":"User","site_admin":false},"repo":{"id":3848853,"name":"uPortal","full_name":"drewwills/uPortal","owner":{"login":"drewwills","id":1127174,"avatar_url":"https://avatars.githubusercontent.com/u/1127174?v=3","gravatar_id":"","url":"https://api.github.com/users/drewwills","html_url":"https://github.com/drewwills","followers_url":"https://api.github.com/users/drewwills/followers","following_url":"https://api.github.com/users/drewwills/following{/other_user}","gists_url":"https://api.github.com/users/drewwills/gists{/gist_id}","starred_url":"https://api.github.com/users/drewwills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewwills/subscriptions","organizations_url":"https://api.github.com/users/drewwills/orgs","repos_url":"https://api.github.com/users/drewwills/repos","events_url":"https://api.github.com/users/drewwills/events{/privacy}","received_events_url":"https://api.github.com/users/drewwills/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/drewwills/uPortal","description":"Enterprise open source portal built by and for the higher education community.","fork":true,"url":"https://api.github.com/repos/drewwills/uPortal","forks_url":"https://api.github.com/repos/drewwills/uPortal/forks","keys_url":"https://api.github.com/repos/drewwills/uPortal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/drewwills/uPortal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/drewwills/uPortal/teams","hooks_url":"https://api.github.com/repos/drewwills/uPortal/hooks","issue_events_url":"https://api.github.com/repos/drewwills/uPortal/issues/events{/number}","events_url":"https://api.github.com/repos/drewwills/uPortal/events","assignees_url":"https://api.github.com/repos/drewwills/uPortal/assignees{/user}","branches_url":"https://api.github.com/repos/drewwills/uPortal/branches{/branch}","tags_url":"https://api.github.com/repos/drewwills/uPortal/tags","blobs_url":"https://api.github.com/repos/drewwills/uPortal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/drewwills/uPortal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/drewwills/uPortal/git/refs{/sha}","trees_url":"https://api.github.com/repos/drewwills/uPortal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/drewwills/uPortal/statuses/{sha}","languages_url":"https://api.github.com/repos/drewwills/uPortal/languages","stargazers_url":"https://api.github.com/repos/drewwills/uPortal/stargazers","contributors_url":"https://api.github.com/repos/drewwills/uPortal/contributors","subscribers_url":"https://api.github.com/repos/drewwills/uPortal/subscribers","subscription_url":"https://api.github.com/repos/drewwills/uPortal/subscription","commits_url":"https://api.github.com/repos/drewwills/uPortal/commits{/sha}","git_commits_url":"https://api.github.com/repos/drewwills/uPortal/git/commits{/sha}","comments_url":"https://api.github.com/repos/drewwills/uPortal/comments{/number}","issue_comment_url":"https://api.github.com/repos/drewwills/uPortal/issues/comments{/number}","contents_url":"https://api.github.com/repos/drewwills/uPortal/contents/{+path}","compare_url":"https://api.github.com/repos/drewwills/uPortal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/drewwills/uPortal/merges","archive_url":"https://api.github.com/repos/drewwills/uPortal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/drewwills/uPortal/downloads","issues_url":"https://api.github.com/repos/drewwills/uPortal/issues{/number}","pulls_url":"https://api.github.com/repos/drewwills/uPortal/pulls{/number}","milestones_url":"https://api.github.com/repos/drewwills/uPortal/milestones{/number}","notifications_url":"https://api.github.com/repos/drewwills/uPortal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/drewwills/uPortal/labels{/name}","releases_url":"https://api.github.com/repos/drewwills/uPortal/releases{/id}","created_at":"2012-03-27T21:40:59Z","updated_at":"2014-06-24T21:27:06Z","pushed_at":"2015-06-22T23:45:06Z","git_url":"git://github.com/drewwills/uPortal.git","ssh_url":"git@github.com:drewwills/uPortal.git","clone_url":"https://github.com/drewwills/uPortal.git","svn_url":"https://github.com/drewwills/uPortal","homepage":"http://www.jasig.org/uportal","size":142893,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"Jasig:master","ref":"master","sha":"5418483f2fafc3f371aeef9a8e3f9965b20db1f3","user":{"login":"Jasig","id":884285,"avatar_url":"https://avatars.githubusercontent.com/u/884285?v=3","gravatar_id":"","url":"https://api.github.com/users/Jasig","html_url":"https://github.com/Jasig","followers_url":"https://api.github.com/users/Jasig/followers","following_url":"https://api.github.com/users/Jasig/following{/other_user}","gists_url":"https://api.github.com/users/Jasig/gists{/gist_id}","starred_url":"https://api.github.com/users/Jasig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jasig/subscriptions","organizations_url":"https://api.github.com/users/Jasig/orgs","repos_url":"https://api.github.com/users/Jasig/repos","events_url":"https://api.github.com/users/Jasig/events{/privacy}","received_events_url":"https://api.github.com/users/Jasig/received_events","type":"Organization","site_admin":false},"repo":{"id":2614085,"name":"uPortal","full_name":"Jasig/uPortal","owner":{"login":"Jasig","id":884285,"avatar_url":"https://avatars.githubusercontent.com/u/884285?v=3","gravatar_id":"","url":"https://api.github.com/users/Jasig","html_url":"https://github.com/Jasig","followers_url":"https://api.github.com/users/Jasig/followers","following_url":"https://api.github.com/users/Jasig/following{/other_user}","gists_url":"https://api.github.com/users/Jasig/gists{/gist_id}","starred_url":"https://api.github.com/users/Jasig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jasig/subscriptions","organizations_url":"https://api.github.com/users/Jasig/orgs","repos_url":"https://api.github.com/users/Jasig/repos","events_url":"https://api.github.com/users/Jasig/events{/privacy}","received_events_url":"https://api.github.com/users/Jasig/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Jasig/uPortal","description":"Enterprise open source portal built by and for the higher education community.","fork":false,"url":"https://api.github.com/repos/Jasig/uPortal","forks_url":"https://api.github.com/repos/Jasig/uPortal/forks","keys_url":"https://api.github.com/repos/Jasig/uPortal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Jasig/uPortal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Jasig/uPortal/teams","hooks_url":"https://api.github.com/repos/Jasig/uPortal/hooks","issue_events_url":"https://api.github.com/repos/Jasig/uPortal/issues/events{/number}","events_url":"https://api.github.com/repos/Jasig/uPortal/events","assignees_url":"https://api.github.com/repos/Jasig/uPortal/assignees{/user}","branches_url":"https://api.github.com/repos/Jasig/uPortal/branches{/branch}","tags_url":"https://api.github.com/repos/Jasig/uPortal/tags","blobs_url":"https://api.github.com/repos/Jasig/uPortal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Jasig/uPortal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Jasig/uPortal/git/refs{/sha}","trees_url":"https://api.github.com/repos/Jasig/uPortal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Jasig/uPortal/statuses/{sha}","languages_url":"https://api.github.com/repos/Jasig/uPortal/languages","stargazers_url":"https://api.github.com/repos/Jasig/uPortal/stargazers","contributors_url":"https://api.github.com/repos/Jasig/uPortal/contributors","subscribers_url":"https://api.github.com/repos/Jasig/uPortal/subscribers","subscription_url":"https://api.github.com/repos/Jasig/uPortal/subscription","commits_url":"https://api.github.com/repos/Jasig/uPortal/commits{/sha}","git_commits_url":"https://api.github.com/repos/Jasig/uPortal/git/commits{/sha}","comments_url":"https://api.github.com/repos/Jasig/uPortal/comments{/number}","issue_comment_url":"https://api.github.com/repos/Jasig/uPortal/issues/comments{/number}","contents_url":"https://api.github.com/repos/Jasig/uPortal/contents/{+path}","compare_url":"https://api.github.com/repos/Jasig/uPortal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Jasig/uPortal/merges","archive_url":"https://api.github.com/repos/Jasig/uPortal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Jasig/uPortal/downloads","issues_url":"https://api.github.com/repos/Jasig/uPortal/issues{/number}","pulls_url":"https://api.github.com/repos/Jasig/uPortal/pulls{/number}","milestones_url":"https://api.github.com/repos/Jasig/uPortal/milestones{/number}","notifications_url":"https://api.github.com/repos/Jasig/uPortal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Jasig/uPortal/labels{/name}","releases_url":"https://api.github.com/repos/Jasig/uPortal/releases{/id}","created_at":"2011-10-20T15:34:22Z","updated_at":"2015-05-19T11:44:32Z","pushed_at":"2015-06-22T23:45:03Z","git_url":"git://github.com/Jasig/uPortal.git","ssh_url":"git@github.com:Jasig/uPortal.git","clone_url":"https://github.com/Jasig/uPortal.git","svn_url":"https://github.com/Jasig/uPortal","homepage":"http://www.jasig.org/uportal","size":222806,"stargazers_count":98,"watchers_count":98,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":151,"mirror_url":null,"open_issues_count":16,"forks":151,"open_issues":16,"watchers":98,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Jasig/uPortal/pulls/561"},"html":{"href":"https://github.com/Jasig/uPortal/pull/561"},"issue":{"href":"https://api.github.com/repos/Jasig/uPortal/issues/561"},"comments":{"href":"https://api.github.com/repos/Jasig/uPortal/issues/561/comments"},"review_comments":{"href":"https://api.github.com/repos/Jasig/uPortal/pulls/561/comments"},"review_comment":{"href":"https://api.github.com/repos/Jasig/uPortal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Jasig/uPortal/pulls/561/commits"},"statuses":{"href":"https://api.github.com/repos/Jasig/uPortal/statuses/11cc662b4094bd918271b905f64fbc8eaac1ba1a"}}}}