{"action":"created","comment":{"url":"https://api.github.com/repos/WSO2Telco/core-util/pulls/comments/152817213","pull_request_review_id":78725265,"id":152817213,"diff_hunk":"@@ -0,0 +1,68 @@\n+/*******************************************************************************\n+ * Copyright  (c) 2015-2016, WSO2.Telco Inc. (http://www.wso2telco.com) All Rights Reserved.\n+ * <p>\n+ * WSO2.Telco Inc. licences this file to you under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ * <p>\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ * <p>\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ ******************************************************************************/\n+package com.wso2telco.core.userrolepermission.impl;\n+\n+import java.util.ArrayList;\n+import java.util.List;\n+import org.apache.commons.logging.Log;\n+import org.apache.commons.logging.LogFactory;\n+import org.wso2.carbon.user.mgt.stub.types.carbon.UIPermissionNode;\n+import com.wso2telco.core.userrolepermission.util.UserRolePermissionType;\n+\n+public class UIPermission implements UserRolePermission {\n+\n+\tprivate final Log log = LogFactory.getLog(UIPermission.class);\n+\n+\t@Override\n+\tpublic List<String> getUserRolePermissions(UIPermissionNode rootPermissionTree) {\n+\n+\t\tList<String> uiPermissionList = null;\n+\n+\t\ttry {\n+\n+\t\t\tUIPermissionNode[] rootPermissionArray = rootPermissionTree.getNodeList();\n+\n+\t\t\tfor (int i = 0; i < rootPermissionArray.length; i++) {\n+\n+\t\t\t\tString permissionName = rootPermissionArray[i].getDisplayName();\n+\n+\t\t\t\tif (permissionName.equals(UserRolePermissionType.UI_PERMISSION.getTObject())) {\n+\n+\t\t\t\t\tUIPermissionNode[] uiPermissionArray = rootPermissionArray[i].getNodeList();\n+\n+\t\t\t\t\tif (uiPermissionArray.length != 0) {\n+\n+\t\t\t\t\t\tuiPermissionList = new ArrayList<>();\n+\n+\t\t\t\t\t\tfor (int j = 0; j < uiPermissionArray.length; j++) {\n+\n+\t\t\t\t\t\t\tif(uiPermissionArray[j].getSelected()){\n+\t\t\t\t\t\t\t\t\n+\t\t\t\t\t\t\t\tuiPermissionList.add(uiPermissionArray[j].getDisplayName());\n+\t\t\t\t\t\t\t}\t\t\t\t\t\t\n+\t\t\t\t\t\t}\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t}\n+\t\t} catch (Exception e) {","path":"components/security/user-role-permission/src/main/java/com/wso2telco/core/userrolepermission/impl/UIPermission.java","position":60,"original_position":60,"commit_id":"42e3f1561566996d0dcfb3c811faf849ae5e76fe","original_commit_id":"42e3f1561566996d0dcfb3c811faf849ae5e76fe","user":{"login":"Nuwan-Walisundara","id":12545131,"avatar_url":"https://avatars0.githubusercontent.com/u/12545131?v=4","gravatar_id":"","url":"https://api.github.com/users/Nuwan-Walisundara","html_url":"https://github.com/Nuwan-Walisundara","followers_url":"https://api.github.com/users/Nuwan-Walisundara/followers","following_url":"https://api.github.com/users/Nuwan-Walisundara/following{/other_user}","gists_url":"https://api.github.com/users/Nuwan-Walisundara/gists{/gist_id}","starred_url":"https://api.github.com/users/Nuwan-Walisundara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nuwan-Walisundara/subscriptions","organizations_url":"https://api.github.com/users/Nuwan-Walisundara/orgs","repos_url":"https://api.github.com/users/Nuwan-Walisundara/repos","events_url":"https://api.github.com/users/Nuwan-Walisundara/events{/privacy}","received_events_url":"https://api.github.com/users/Nuwan-Walisundara/received_events","type":"User","site_admin":false},"body":"if excetion do not return null object, instead return empty list","created_at":"2017-11-23T14:44:14Z","updated_at":"2017-11-23T14:55:52Z","html_url":"https://github.com/WSO2Telco/core-util/pull/131#discussion_r152817213","pull_request_url":"https://api.github.com/repos/WSO2Telco/core-util/pulls/131","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/WSO2Telco/core-util/pulls/comments/152817213"},"html":{"href":"https://github.com/WSO2Telco/core-util/pull/131#discussion_r152817213"},"pull_request":{"href":"https://api.github.com/repos/WSO2Telco/core-util/pulls/131"}}},"pull_request":{"url":"https://api.github.com/repos/WSO2Telco/core-util/pulls/131","id":154340772,"html_url":"https://github.com/WSO2Telco/core-util/pull/131","diff_url":"https://github.com/WSO2Telco/core-util/pull/131.diff","patch_url":"https://github.com/WSO2Telco/core-util/pull/131.patch","issue_url":"https://api.github.com/repos/WSO2Telco/core-util/issues/131","number":131,"state":"open","locked":false,"title":"Permission module","user":{"login":"shawijayasekera","id":15683003,"avatar_url":"https://avatars1.githubusercontent.com/u/15683003?v=4","gravatar_id":"","url":"https://api.github.com/users/shawijayasekera","html_url":"https://github.com/shawijayasekera","followers_url":"https://api.github.com/users/shawijayasekera/followers","following_url":"https://api.github.com/users/shawijayasekera/following{/other_user}","gists_url":"https://api.github.com/users/shawijayasekera/gists{/gist_id}","starred_url":"https://api.github.com/users/shawijayasekera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shawijayasekera/subscriptions","organizations_url":"https://api.github.com/users/shawijayasekera/orgs","repos_url":"https://api.github.com/users/shawijayasekera/repos","events_url":"https://api.github.com/users/shawijayasekera/events{/privacy}","received_events_url":"https://api.github.com/users/shawijayasekera/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-11-23T10:27:33Z","updated_at":"2017-11-23T14:55:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0e0e0befed156dffecdb97a90b2dcac4749666e","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/WSO2Telco/core-util/pulls/131/commits","review_comments_url":"https://api.github.com/repos/WSO2Telco/core-util/pulls/131/comments","review_comment_url":"https://api.github.com/repos/WSO2Telco/core-util/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WSO2Telco/core-util/issues/131/comments","statuses_url":"https://api.github.com/repos/WSO2Telco/core-util/statuses/42e3f1561566996d0dcfb3c811faf849ae5e76fe","head":{"label":"shawijayasekera:permission_module","ref":"permission_module","sha":"42e3f1561566996d0dcfb3c811faf849ae5e76fe","user":{"login":"shawijayasekera","id":15683003,"avatar_url":"https://avatars1.githubusercontent.com/u/15683003?v=4","gravatar_id":"","url":"https://api.github.com/users/shawijayasekera","html_url":"https://github.com/shawijayasekera","followers_url":"https://api.github.com/users/shawijayasekera/followers","following_url":"https://api.github.com/users/shawijayasekera/following{/other_user}","gists_url":"https://api.github.com/users/shawijayasekera/gists{/gist_id}","starred_url":"https://api.github.com/users/shawijayasekera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shawijayasekera/subscriptions","organizations_url":"https://api.github.com/users/shawijayasekera/orgs","repos_url":"https://api.github.com/users/shawijayasekera/repos","events_url":"https://api.github.com/users/shawijayasekera/events{/privacy}","received_events_url":"https://api.github.com/users/shawijayasekera/received_events","type":"User","site_admin":false},"repo":{"id":77980136,"name":"core-util","full_name":"shawijayasekera/core-util","owner":{"login":"shawijayasekera","id":15683003,"avatar_url":"https://avatars1.githubusercontent.com/u/15683003?v=4","gravatar_id":"","url":"https://api.github.com/users/shawijayasekera","html_url":"https://github.com/shawijayasekera","followers_url":"https://api.github.com/users/shawijayasekera/followers","following_url":"https://api.github.com/users/shawijayasekera/following{/other_user}","gists_url":"https://api.github.com/users/shawijayasekera/gists{/gist_id}","starred_url":"https://api.github.com/users/shawijayasekera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shawijayasekera/subscriptions","organizations_url":"https://api.github.com/users/shawijayasekera/orgs","repos_url":"https://api.github.com/users/shawijayasekera/repos","events_url":"https://api.github.com/users/shawijayasekera/events{/privacy}","received_events_url":"https://api.github.com/users/shawijayasekera/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shawijayasekera/core-util","description":"Support utilities goes within this module. ","fork":true,"url":"https://api.github.com/repos/shawijayasekera/core-util","forks_url":"https://api.github.com/repos/shawijayasekera/core-util/forks","keys_url":"https://api.github.com/repos/shawijayasekera/core-util/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shawijayasekera/core-util/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shawijayasekera/core-util/teams","hooks_url":"https://api.github.com/repos/shawijayasekera/core-util/hooks","issue_events_url":"https://api.github.com/repos/shawijayasekera/core-util/issues/events{/number}","events_url":"https://api.github.com/repos/shawijayasekera/core-util/events","assignees_url":"https://api.github.com/repos/shawijayasekera/core-util/assignees{/user}","branches_url":"https://api.github.com/repos/shawijayasekera/core-util/branches{/branch}","tags_url":"https://api.github.com/repos/shawijayasekera/core-util/tags","blobs_url":"https://api.github.com/repos/shawijayasekera/core-util/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shawijayasekera/core-util/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shawijayasekera/core-util/git/refs{/sha}","trees_url":"https://api.github.com/repos/shawijayasekera/core-util/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shawijayasekera/core-util/statuses/{sha}","languages_url":"https://api.github.com/repos/shawijayasekera/core-util/languages","stargazers_url":"https://api.github.com/repos/shawijayasekera/core-util/stargazers","contributors_url":"https://api.github.com/repos/shawijayasekera/core-util/contributors","subscribers_url":"https://api.github.com/repos/shawijayasekera/core-util/subscribers","subscription_url":"https://api.github.com/repos/shawijayasekera/core-util/subscription","commits_url":"https://api.github.com/repos/shawijayasekera/core-util/commits{/sha}","git_commits_url":"https://api.github.com/repos/shawijayasekera/core-util/git/commits{/sha}","comments_url":"https://api.github.com/repos/shawijayasekera/core-util/comments{/number}","issue_comment_url":"https://api.github.com/repos/shawijayasekera/core-util/issues/comments{/number}","contents_url":"https://api.github.com/repos/shawijayasekera/core-util/contents/{+path}","compare_url":"https://api.github.com/repos/shawijayasekera/core-util/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shawijayasekera/core-util/merges","archive_url":"https://api.github.com/repos/shawijayasekera/core-util/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shawijayasekera/core-util/downloads","issues_url":"https://api.github.com/repos/shawijayasekera/core-util/issues{/number}","pulls_url":"https://api.github.com/repos/shawijayasekera/core-util/pulls{/number}","milestones_url":"https://api.github.com/repos/shawijayasekera/core-util/milestones{/number}","notifications_url":"https://api.github.com/repos/shawijayasekera/core-util/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shawijayasekera/core-util/labels{/name}","releases_url":"https://api.github.com/repos/shawijayasekera/core-util/releases{/id}","deployments_url":"https://api.github.com/repos/shawijayasekera/core-util/deployments","created_at":"2017-01-04T04:21:22Z","updated_at":"2017-01-04T04:21:24Z","pushed_at":"2017-11-23T10:26:41Z","git_url":"git://github.com/shawijayasekera/core-util.git","ssh_url":"git@github.com:shawijayasekera/core-util.git","clone_url":"https://github.com/shawijayasekera/core-util.git","svn_url":"https://github.com/shawijayasekera/core-util","homepage":null,"size":780,"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,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"WSO2Telco:master","ref":"master","sha":"fd327c904ca6f1ba9e0f0ecaf46ee0629e9fb89c","user":{"login":"WSO2Telco","id":15646154,"avatar_url":"https://avatars2.githubusercontent.com/u/15646154?v=4","gravatar_id":"","url":"https://api.github.com/users/WSO2Telco","html_url":"https://github.com/WSO2Telco","followers_url":"https://api.github.com/users/WSO2Telco/followers","following_url":"https://api.github.com/users/WSO2Telco/following{/other_user}","gists_url":"https://api.github.com/users/WSO2Telco/gists{/gist_id}","starred_url":"https://api.github.com/users/WSO2Telco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WSO2Telco/subscriptions","organizations_url":"https://api.github.com/users/WSO2Telco/orgs","repos_url":"https://api.github.com/users/WSO2Telco/repos","events_url":"https://api.github.com/users/WSO2Telco/events{/privacy}","received_events_url":"https://api.github.com/users/WSO2Telco/received_events","type":"Organization","site_admin":false},"repo":{"id":49925179,"name":"core-util","full_name":"WSO2Telco/core-util","owner":{"login":"WSO2Telco","id":15646154,"avatar_url":"https://avatars2.githubusercontent.com/u/15646154?v=4","gravatar_id":"","url":"https://api.github.com/users/WSO2Telco","html_url":"https://github.com/WSO2Telco","followers_url":"https://api.github.com/users/WSO2Telco/followers","following_url":"https://api.github.com/users/WSO2Telco/following{/other_user}","gists_url":"https://api.github.com/users/WSO2Telco/gists{/gist_id}","starred_url":"https://api.github.com/users/WSO2Telco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WSO2Telco/subscriptions","organizations_url":"https://api.github.com/users/WSO2Telco/orgs","repos_url":"https://api.github.com/users/WSO2Telco/repos","events_url":"https://api.github.com/users/WSO2Telco/events{/privacy}","received_events_url":"https://api.github.com/users/WSO2Telco/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WSO2Telco/core-util","description":"Support utilities goes within this module. ","fork":false,"url":"https://api.github.com/repos/WSO2Telco/core-util","forks_url":"https://api.github.com/repos/WSO2Telco/core-util/forks","keys_url":"https://api.github.com/repos/WSO2Telco/core-util/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WSO2Telco/core-util/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WSO2Telco/core-util/teams","hooks_url":"https://api.github.com/repos/WSO2Telco/core-util/hooks","issue_events_url":"https://api.github.com/repos/WSO2Telco/core-util/issues/events{/number}","events_url":"https://api.github.com/repos/WSO2Telco/core-util/events","assignees_url":"https://api.github.com/repos/WSO2Telco/core-util/assignees{/user}","branches_url":"https://api.github.com/repos/WSO2Telco/core-util/branches{/branch}","tags_url":"https://api.github.com/repos/WSO2Telco/core-util/tags","blobs_url":"https://api.github.com/repos/WSO2Telco/core-util/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WSO2Telco/core-util/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WSO2Telco/core-util/git/refs{/sha}","trees_url":"https://api.github.com/repos/WSO2Telco/core-util/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WSO2Telco/core-util/statuses/{sha}","languages_url":"https://api.github.com/repos/WSO2Telco/core-util/languages","stargazers_url":"https://api.github.com/repos/WSO2Telco/core-util/stargazers","contributors_url":"https://api.github.com/repos/WSO2Telco/core-util/contributors","subscribers_url":"https://api.github.com/repos/WSO2Telco/core-util/subscribers","subscription_url":"https://api.github.com/repos/WSO2Telco/core-util/subscription","commits_url":"https://api.github.com/repos/WSO2Telco/core-util/commits{/sha}","git_commits_url":"https://api.github.com/repos/WSO2Telco/core-util/git/commits{/sha}","comments_url":"https://api.github.com/repos/WSO2Telco/core-util/comments{/number}","issue_comment_url":"https://api.github.com/repos/WSO2Telco/core-util/issues/comments{/number}","contents_url":"https://api.github.com/repos/WSO2Telco/core-util/contents/{+path}","compare_url":"https://api.github.com/repos/WSO2Telco/core-util/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WSO2Telco/core-util/merges","archive_url":"https://api.github.com/repos/WSO2Telco/core-util/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WSO2Telco/core-util/downloads","issues_url":"https://api.github.com/repos/WSO2Telco/core-util/issues{/number}","pulls_url":"https://api.github.com/repos/WSO2Telco/core-util/pulls{/number}","milestones_url":"https://api.github.com/repos/WSO2Telco/core-util/milestones{/number}","notifications_url":"https://api.github.com/repos/WSO2Telco/core-util/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WSO2Telco/core-util/labels{/name}","releases_url":"https://api.github.com/repos/WSO2Telco/core-util/releases{/id}","deployments_url":"https://api.github.com/repos/WSO2Telco/core-util/deployments","created_at":"2016-01-19T04:02:45Z","updated_at":"2017-11-10T02:20:22Z","pushed_at":"2017-11-23T10:27:33Z","git_url":"git://github.com/WSO2Telco/core-util.git","ssh_url":"git@github.com:WSO2Telco/core-util.git","clone_url":"https://github.com/WSO2Telco/core-util.git","svn_url":"https://github.com/WSO2Telco/core-util","homepage":null,"size":897,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":51,"mirror_url":null,"archived":false,"open_issues_count":2,"forks":51,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WSO2Telco/core-util/pulls/131"},"html":{"href":"https://github.com/WSO2Telco/core-util/pull/131"},"issue":{"href":"https://api.github.com/repos/WSO2Telco/core-util/issues/131"},"comments":{"href":"https://api.github.com/repos/WSO2Telco/core-util/issues/131/comments"},"review_comments":{"href":"https://api.github.com/repos/WSO2Telco/core-util/pulls/131/comments"},"review_comment":{"href":"https://api.github.com/repos/WSO2Telco/core-util/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WSO2Telco/core-util/pulls/131/commits"},"statuses":{"href":"https://api.github.com/repos/WSO2Telco/core-util/statuses/42e3f1561566996d0dcfb3c811faf849ae5e76fe"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Nuwan-Walisundara"}}