{"action":"created","comment":{"url":"https://api.github.com/repos/molgenis/molgenis/pulls/comments/90393039","pull_request_review_id":10910827,"id":90393039,"diff_hunk":"@@ -44,144 +48,134 @@ public PermissionManagerController(PermissionManagerService pluginPermissionMana\n \t\t\tUserAuthorityFactory userAuthorityFactory, GroupAuthorityFactory groupAuthorityFactory)\n \t{\n \t\tsuper(URI);\n+\n \t\tthis.pluginPermissionManagerService = requireNonNull(pluginPermissionManagerService);\n \t\tthis.userAuthorityFactory = requireNonNull(userAuthorityFactory);\n \t\tthis.groupAuthorityFactory = requireNonNull(groupAuthorityFactory);\n \t}\n \n-\t@RequestMapping(method = RequestMethod.GET)\n+\t@RequestMapping(method = GET)\n \tpublic String init(Model model)\n \t{\n-\t\tmodel.addAttribute(\"users\", Lists.newArrayList(\n-\t\t\t\tIterables.filter(pluginPermissionManagerService.getUsers(), new Predicate<User>()\n-\t\t\t\t{\n-\t\t\t\t\t@Override\n-\t\t\t\t\tpublic boolean apply(User user)\n-\t\t\t\t\t{\n-\t\t\t\t\t\tBoolean superuser = user.isSuperuser();\n-\t\t\t\t\t\treturn superuser == null || !superuser;\n-\t\t\t\t\t}\n-\t\t\t\t})));\n+\t\tmodel.addAttribute(\"users\", Lists.newArrayList(pluginPermissionManagerService.getUsers().stream().filter(user ->\n+\t\t{\n+\t\t\tBoolean superuser = user.isSuperuser();\n+\t\t\treturn superuser == null || !superuser;\n+\t\t}).collect(Collectors.toList())));\n \t\tmodel.addAttribute(\"groups\", pluginPermissionManagerService.getGroups());\n \t\treturn \"view-permissionmanager\";\n \t}\n \n-\t@RequestMapping(value = \"/plugin/group/{groupId}\", method = RequestMethod.GET)\n+\t@RequestMapping(value = \"/plugin/group/{groupId}\", method = GET)\n \t@ResponseBody\n \tpublic Permissions getGroupPluginPermissions(@PathVariable String groupId)\n \t{\n \t\treturn pluginPermissionManagerService.getGroupPluginPermissions(groupId);\n \t}\n \n-\t@RequestMapping(value = \"/entityclass/group/{groupId}\", method = RequestMethod.GET)\n+\t@RequestMapping(value = \"/entityclass/group/{groupId}\", method = GET)\n \t@ResponseBody\n \tpublic Permissions getGroupEntityClassPermissions(@PathVariable String groupId)\n \t{\n \t\treturn pluginPermissionManagerService.getGroupEntityClassPermissions(groupId);\n \t}\n \n-\t@RequestMapping(value = \"/plugin/user/{userId}\", method = RequestMethod.GET)\n+\t@RequestMapping(value = \"/plugin/user/{userId}\", method = GET)\n \t@ResponseBody\n \tpublic Permissions getUserPluginPermissions(@PathVariable String userId)\n \t{\n \t\treturn pluginPermissionManagerService.getUserPluginPermissions(userId);\n \t}\n \n-\t@RequestMapping(value = \"/entityclass/user/{userId}\", method = RequestMethod.GET)\n+\t@RequestMapping(value = \"/entityclass/user/{userId}\", method = GET)\n \t@ResponseBody\n \tpublic Permissions getUserEntityClassPermissions(@PathVariable String userId)\n \t{\n \t\treturn pluginPermissionManagerService.getUserEntityClassPermissions(userId);\n \t}\n \n-\t@RequestMapping(value = \"/update/plugin/group\", method = RequestMethod.POST)\n+\t@RequestMapping(value = \"/update/plugin/group\", method = POST)\n \t@ResponseStatus(HttpStatus.OK)\n \tpublic void updateGroupPluginPermissions(@RequestParam String groupId, WebRequest webRequest)\n \t{\n-\t\tList<GroupAuthority> authorities = new ArrayList<GroupAuthority>();\n+\t\tList<GroupAuthority> authorities = new ArrayList<>();\n \t\tfor (MolgenisPlugin plugin : pluginPermissionManagerService.getPlugins())\n \t\t{\n-\t\t\tString param = \"radio-\" + plugin.getId();\n-\t\t\tString value = webRequest.getParameter(param);\n+\t\t\tString pluginName = plugin.getId();\n+\t\t\tString value = webRequest.getParameter(\"radio-\" + pluginName);\n \n-\t\t\tif (value.equalsIgnoreCase(Permission.READ.toString()) || value\n-\t\t\t\t\t.equalsIgnoreCase(Permission.COUNT.toString()) || value\n-\t\t\t\t\t.equalsIgnoreCase(Permission.WRITE.toString()) || value\n-\t\t\t\t\t.equalsIgnoreCase(Permission.WRITEMETA.toString()))\n+\t\t\tif (value.equalsIgnoreCase(COUNT.toString()) || value.equalsIgnoreCase(READ.toString()) || value\n+\t\t\t\t\t.equalsIgnoreCase(WRITE.toString()) || value.equalsIgnoreCase(WRITEMETA.toString()))\n \t\t\t{\n-\t\t\t\tGroupAuthority authority = groupAuthorityFactory.create();\n-\t\t\t\tauthority.setRole(SecurityUtils.AUTHORITY_PLUGIN_PREFIX + value.toUpperCase() + \"_\" + plugin.getId()\n-\t\t\t\t\t\t.toUpperCase());\n-\t\t\t\tauthorities.add(authority);\n+\t\t\t\tauthorities.add(createGroupAuthority(\n+\t\t\t\t\t\tAUTHORITY_PLUGIN_PREFIX + value.toUpperCase() + \"_\" + pluginName.toUpperCase()));\n+\n+\t\t\t\tauthorities.addAll(plugin.getRequiredSettingEntities().stream()\n+\t\t\t\t\t\t.map(settingEntityName -> createGroupAuthority(\n+\t\t\t\t\t\t\t\tAUTHORITY_ENTITY_READ_PREFIX + settingEntityName.toUpperCase()))","path":"molgenis-core-ui/src/main/java/org/molgenis/ui/admin/permission/PermissionManagerController.java","position":144,"original_position":144,"commit_id":"8b7496d83cf6bc176a5f652d0176cb899fd23baf","original_commit_id":"8b7496d83cf6bc176a5f652d0176cb899fd23baf","user":{"login":"Mark-de-Haan","id":3625016,"avatar_url":"https://avatars.githubusercontent.com/u/3625016?v=3","gravatar_id":"","url":"https://api.github.com/users/Mark-de-Haan","html_url":"https://github.com/Mark-de-Haan","followers_url":"https://api.github.com/users/Mark-de-Haan/followers","following_url":"https://api.github.com/users/Mark-de-Haan/following{/other_user}","gists_url":"https://api.github.com/users/Mark-de-Haan/gists{/gist_id}","starred_url":"https://api.github.com/users/Mark-de-Haan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mark-de-Haan/subscriptions","organizations_url":"https://api.github.com/users/Mark-de-Haan/orgs","repos_url":"https://api.github.com/users/Mark-de-Haan/repos","events_url":"https://api.github.com/users/Mark-de-Haan/events{/privacy}","received_events_url":"https://api.github.com/users/Mark-de-Haan/received_events","type":"User","site_admin":false},"body":"I was thinking about this as well, I guess you want to supply a Map<Entity, PermissionType> for every plugin","created_at":"2016-12-01T07:04:44Z","updated_at":"2016-12-01T07:04:44Z","html_url":"https://github.com/molgenis/molgenis/pull/5652#discussion_r90393039","pull_request_url":"https://api.github.com/repos/molgenis/molgenis/pulls/5652","_links":{"self":{"href":"https://api.github.com/repos/molgenis/molgenis/pulls/comments/90393039"},"html":{"href":"https://github.com/molgenis/molgenis/pull/5652#discussion_r90393039"},"pull_request":{"href":"https://api.github.com/repos/molgenis/molgenis/pulls/5652"}}},"pull_request":{"url":"https://api.github.com/repos/molgenis/molgenis/pulls/5652","id":95700697,"html_url":"https://github.com/molgenis/molgenis/pull/5652","diff_url":"https://github.com/molgenis/molgenis/pull/5652.diff","patch_url":"https://github.com/molgenis/molgenis/pull/5652.patch","issue_url":"https://api.github.com/repos/molgenis/molgenis/issues/5652","number":5652,"state":"open","locked":false,"title":"Set Setting Entity VIEW permissions automatically when setting plugin permissions","user":{"login":"Mark-de-Haan","id":3625016,"avatar_url":"https://avatars.githubusercontent.com/u/3625016?v=3","gravatar_id":"","url":"https://api.github.com/users/Mark-de-Haan","html_url":"https://github.com/Mark-de-Haan","followers_url":"https://api.github.com/users/Mark-de-Haan/followers","following_url":"https://api.github.com/users/Mark-de-Haan/following{/other_user}","gists_url":"https://api.github.com/users/Mark-de-Haan/gists{/gist_id}","starred_url":"https://api.github.com/users/Mark-de-Haan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mark-de-Haan/subscriptions","organizations_url":"https://api.github.com/users/Mark-de-Haan/orgs","repos_url":"https://api.github.com/users/Mark-de-Haan/repos","events_url":"https://api.github.com/users/Mark-de-Haan/events{/privacy}","received_events_url":"https://api.github.com/users/Mark-de-Haan/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-29T14:20:13Z","updated_at":"2016-12-01T07:04:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0f9df315623ca19335098199e27cd7c88fcec599","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/molgenis/molgenis/pulls/5652/commits","review_comments_url":"https://api.github.com/repos/molgenis/molgenis/pulls/5652/comments","review_comment_url":"https://api.github.com/repos/molgenis/molgenis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/molgenis/molgenis/issues/5652/comments","statuses_url":"https://api.github.com/repos/molgenis/molgenis/statuses/8b7496d83cf6bc176a5f652d0176cb899fd23baf","head":{"label":"Mark-de-Haan:feature/auto_plugin_permissions","ref":"feature/auto_plugin_permissions","sha":"8b7496d83cf6bc176a5f652d0176cb899fd23baf","user":{"login":"Mark-de-Haan","id":3625016,"avatar_url":"https://avatars.githubusercontent.com/u/3625016?v=3","gravatar_id":"","url":"https://api.github.com/users/Mark-de-Haan","html_url":"https://github.com/Mark-de-Haan","followers_url":"https://api.github.com/users/Mark-de-Haan/followers","following_url":"https://api.github.com/users/Mark-de-Haan/following{/other_user}","gists_url":"https://api.github.com/users/Mark-de-Haan/gists{/gist_id}","starred_url":"https://api.github.com/users/Mark-de-Haan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mark-de-Haan/subscriptions","organizations_url":"https://api.github.com/users/Mark-de-Haan/orgs","repos_url":"https://api.github.com/users/Mark-de-Haan/repos","events_url":"https://api.github.com/users/Mark-de-Haan/events{/privacy}","received_events_url":"https://api.github.com/users/Mark-de-Haan/received_events","type":"User","site_admin":false},"repo":{"id":27178136,"name":"molgenis","full_name":"Mark-de-Haan/molgenis","owner":{"login":"Mark-de-Haan","id":3625016,"avatar_url":"https://avatars.githubusercontent.com/u/3625016?v=3","gravatar_id":"","url":"https://api.github.com/users/Mark-de-Haan","html_url":"https://github.com/Mark-de-Haan","followers_url":"https://api.github.com/users/Mark-de-Haan/followers","following_url":"https://api.github.com/users/Mark-de-Haan/following{/other_user}","gists_url":"https://api.github.com/users/Mark-de-Haan/gists{/gist_id}","starred_url":"https://api.github.com/users/Mark-de-Haan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mark-de-Haan/subscriptions","organizations_url":"https://api.github.com/users/Mark-de-Haan/orgs","repos_url":"https://api.github.com/users/Mark-de-Haan/repos","events_url":"https://api.github.com/users/Mark-de-Haan/events{/privacy}","received_events_url":"https://api.github.com/users/Mark-de-Haan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Mark-de-Haan/molgenis","description":"MOLGENIS is an collaborative open source project on a mission to generate great software infrastructure for life science research. ","fork":true,"url":"https://api.github.com/repos/Mark-de-Haan/molgenis","forks_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/forks","keys_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/teams","hooks_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/hooks","issue_events_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/issues/events{/number}","events_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/events","assignees_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/assignees{/user}","branches_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/branches{/branch}","tags_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/tags","blobs_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/statuses/{sha}","languages_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/languages","stargazers_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/stargazers","contributors_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/contributors","subscribers_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/subscribers","subscription_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/subscription","commits_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/contents/{+path}","compare_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/merges","archive_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/downloads","issues_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/issues{/number}","pulls_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/pulls{/number}","milestones_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/milestones{/number}","notifications_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/labels{/name}","releases_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/releases{/id}","deployments_url":"https://api.github.com/repos/Mark-de-Haan/molgenis/deployments","created_at":"2014-11-26T13:31:44Z","updated_at":"2016-10-24T11:41:11Z","pushed_at":"2016-12-01T06:35:44Z","git_url":"git://github.com/Mark-de-Haan/molgenis.git","ssh_url":"git@github.com:Mark-de-Haan/molgenis.git","clone_url":"https://github.com/Mark-de-Haan/molgenis.git","svn_url":"https://github.com/Mark-de-Haan/molgenis","homepage":"","size":114151,"stargazers_count":1,"watchers_count":1,"language":"Java","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":"master"}},"base":{"label":"molgenis:master","ref":"master","sha":"0f39ff1bc1ee03b9f51ece5969525154a50519d0","user":{"login":"molgenis","id":1688158,"avatar_url":"https://avatars.githubusercontent.com/u/1688158?v=3","gravatar_id":"","url":"https://api.github.com/users/molgenis","html_url":"https://github.com/molgenis","followers_url":"https://api.github.com/users/molgenis/followers","following_url":"https://api.github.com/users/molgenis/following{/other_user}","gists_url":"https://api.github.com/users/molgenis/gists{/gist_id}","starred_url":"https://api.github.com/users/molgenis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/molgenis/subscriptions","organizations_url":"https://api.github.com/users/molgenis/orgs","repos_url":"https://api.github.com/users/molgenis/repos","events_url":"https://api.github.com/users/molgenis/events{/privacy}","received_events_url":"https://api.github.com/users/molgenis/received_events","type":"Organization","site_admin":false},"repo":{"id":8010626,"name":"molgenis","full_name":"molgenis/molgenis","owner":{"login":"molgenis","id":1688158,"avatar_url":"https://avatars.githubusercontent.com/u/1688158?v=3","gravatar_id":"","url":"https://api.github.com/users/molgenis","html_url":"https://github.com/molgenis","followers_url":"https://api.github.com/users/molgenis/followers","following_url":"https://api.github.com/users/molgenis/following{/other_user}","gists_url":"https://api.github.com/users/molgenis/gists{/gist_id}","starred_url":"https://api.github.com/users/molgenis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/molgenis/subscriptions","organizations_url":"https://api.github.com/users/molgenis/orgs","repos_url":"https://api.github.com/users/molgenis/repos","events_url":"https://api.github.com/users/molgenis/events{/privacy}","received_events_url":"https://api.github.com/users/molgenis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/molgenis/molgenis","description":"MOLGENIS - for scientific data: management, exploration, integration and analysis. ","fork":false,"url":"https://api.github.com/repos/molgenis/molgenis","forks_url":"https://api.github.com/repos/molgenis/molgenis/forks","keys_url":"https://api.github.com/repos/molgenis/molgenis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/molgenis/molgenis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/molgenis/molgenis/teams","hooks_url":"https://api.github.com/repos/molgenis/molgenis/hooks","issue_events_url":"https://api.github.com/repos/molgenis/molgenis/issues/events{/number}","events_url":"https://api.github.com/repos/molgenis/molgenis/events","assignees_url":"https://api.github.com/repos/molgenis/molgenis/assignees{/user}","branches_url":"https://api.github.com/repos/molgenis/molgenis/branches{/branch}","tags_url":"https://api.github.com/repos/molgenis/molgenis/tags","blobs_url":"https://api.github.com/repos/molgenis/molgenis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/molgenis/molgenis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/molgenis/molgenis/git/refs{/sha}","trees_url":"https://api.github.com/repos/molgenis/molgenis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/molgenis/molgenis/statuses/{sha}","languages_url":"https://api.github.com/repos/molgenis/molgenis/languages","stargazers_url":"https://api.github.com/repos/molgenis/molgenis/stargazers","contributors_url":"https://api.github.com/repos/molgenis/molgenis/contributors","subscribers_url":"https://api.github.com/repos/molgenis/molgenis/subscribers","subscription_url":"https://api.github.com/repos/molgenis/molgenis/subscription","commits_url":"https://api.github.com/repos/molgenis/molgenis/commits{/sha}","git_commits_url":"https://api.github.com/repos/molgenis/molgenis/git/commits{/sha}","comments_url":"https://api.github.com/repos/molgenis/molgenis/comments{/number}","issue_comment_url":"https://api.github.com/repos/molgenis/molgenis/issues/comments{/number}","contents_url":"https://api.github.com/repos/molgenis/molgenis/contents/{+path}","compare_url":"https://api.github.com/repos/molgenis/molgenis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/molgenis/molgenis/merges","archive_url":"https://api.github.com/repos/molgenis/molgenis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/molgenis/molgenis/downloads","issues_url":"https://api.github.com/repos/molgenis/molgenis/issues{/number}","pulls_url":"https://api.github.com/repos/molgenis/molgenis/pulls{/number}","milestones_url":"https://api.github.com/repos/molgenis/molgenis/milestones{/number}","notifications_url":"https://api.github.com/repos/molgenis/molgenis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/molgenis/molgenis/labels{/name}","releases_url":"https://api.github.com/repos/molgenis/molgenis/releases{/id}","deployments_url":"https://api.github.com/repos/molgenis/molgenis/deployments","created_at":"2013-02-04T16:02:36Z","updated_at":"2016-11-21T12:37:04Z","pushed_at":"2016-12-01T07:04:00Z","git_url":"git://github.com/molgenis/molgenis.git","ssh_url":"git@github.com:molgenis/molgenis.git","clone_url":"https://github.com/molgenis/molgenis.git","svn_url":"https://github.com/molgenis/molgenis","homepage":" https://molgenis.github.io","size":130552,"stargazers_count":32,"watchers_count":32,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":66,"mirror_url":null,"open_issues_count":279,"forks":66,"open_issues":279,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/molgenis/molgenis/pulls/5652"},"html":{"href":"https://github.com/molgenis/molgenis/pull/5652"},"issue":{"href":"https://api.github.com/repos/molgenis/molgenis/issues/5652"},"comments":{"href":"https://api.github.com/repos/molgenis/molgenis/issues/5652/comments"},"review_comments":{"href":"https://api.github.com/repos/molgenis/molgenis/pulls/5652/comments"},"review_comment":{"href":"https://api.github.com/repos/molgenis/molgenis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/molgenis/molgenis/pulls/5652/commits"},"statuses":{"href":"https://api.github.com/repos/molgenis/molgenis/statuses/8b7496d83cf6bc176a5f652d0176cb899fd23baf"}}}}
{"actor":{"display_login":"Mark-de-Haan"}}