{"action":"created","comment":{"url":"https://api.github.com/repos/vivo-project/Vitro/pulls/comments/227961048","pull_request_review_id":167991725,"id":227961048,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNzk2MTA0OA==","diff_hunk":"@@ -15,69 +17,56 @@\n import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle;\n import edu.cornell.mannlib.vitro.webapp.auth.identifier.RequestIdentifiers;\n import edu.cornell.mannlib.vitro.webapp.auth.identifier.common.HasPermission;\n-import edu.cornell.mannlib.vitro.webapp.auth.permissions.DisplayByRolePermission;\n import edu.cornell.mannlib.vitro.webapp.auth.permissions.Permission;\n import edu.cornell.mannlib.vitro.webapp.auth.permissions.PermissionRegistry;\n import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.RequestedAction;\n import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayDataProperty;\n import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayDataPropertyStatement;\n import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayObjectProperty;\n import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.display.DisplayObjectPropertyStatement;\n-import edu.cornell.mannlib.vitro.webapp.beans.DataProperty;\n-import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;\n-import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;\n-import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement;\n \n /**\n  * Filter the properties depending on what DisplayByRolePermission is on the\n  * request. If no request, or no permission, use the Public permission.\n  */\n-public class FilterByRoleLevelPermission extends VitroFiltersImpl {\n-\tprivate static final Log log = LogFactory\n-\t\t\t.getLog(FilterByRoleLevelPermission.class);\n+public class FilterByDisplayPermission extends VitroFiltersImpl {\n+\tprivate static final Log log = LogFactory.getLog(FilterByDisplayPermission.class);\n \n-\tprivate final Permission permission;\n+\tprivate final String permissionSetUri;\n \n-\tprivate static Permission getDefaultPermission(ServletContext ctx) {\n-\t\tif (ctx == null) {\n-\t\t\tthrow new NullPointerException(\"context may not be null.\");\n-\t\t}\n-\n-\t\treturn PermissionRegistry.getRegistry(ctx).getPermission(\n-\t\t\t\tDisplayByRolePermission.NAMESPACE + \"Public\");\n-\t}\n+\t// Set a default permission set uri\n+\tprivate static final String defaultPermissionSetUri = \"\";\n \n-\tprivate static Permission getPermissionFromRequest(HttpServletRequest req) {\n+\tprivate static String getPermissionSetFromRequest(HttpServletRequest req) {\n \t\tif (req == null) {\n \t\t\tthrow new NullPointerException(\"request may not be null.\");\n \t\t}\n \n \t\tIdentifierBundle ids = RequestIdentifiers.getIdBundleForRequest(req);\n-\t\tfor (Permission p : HasPermission.getPermissions(ids)) {\n-\t\t\tif (p instanceof DisplayByRolePermission) {\n-\t\t\t\treturn p;\n-\t\t\t}\n+\t\tfor (String uri : HasPermissionSet.getPermissionSetUris(ids)) {\n+\t\t\treturn uri;","path":"api/src/main/java/edu/cornell/mannlib/vitro/webapp/dao/filtering/filters/FilterByDisplayPermission.java","position":62,"original_position":62,"commit_id":"5d5bab532ae82a0100ff3b1c07913c9e5687845d","original_commit_id":"5d5bab532ae82a0100ff3b1c07913c9e5687845d","user":{"login":"awoods","id":149283,"node_id":"MDQ6VXNlcjE0OTI4Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/149283?v=4","gravatar_id":"","url":"https://api.github.com/users/awoods","html_url":"https://github.com/awoods","followers_url":"https://api.github.com/users/awoods/followers","following_url":"https://api.github.com/users/awoods/following{/other_user}","gists_url":"https://api.github.com/users/awoods/gists{/gist_id}","starred_url":"https://api.github.com/users/awoods/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awoods/subscriptions","organizations_url":"https://api.github.com/users/awoods/orgs","repos_url":"https://api.github.com/users/awoods/repos","events_url":"https://api.github.com/users/awoods/events{/privacy}","received_events_url":"https://api.github.com/users/awoods/received_events","type":"User","site_admin":false},"body":"Since this `for` loop is not looping, the logic may be more clear to simply return the first element if the permission-set is not empty.","created_at":"2018-10-24T21:10:13Z","updated_at":"2018-10-24T21:34:16Z","html_url":"https://github.com/vivo-project/Vitro/pull/80#discussion_r227961048","pull_request_url":"https://api.github.com/repos/vivo-project/Vitro/pulls/80","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/vivo-project/Vitro/pulls/comments/227961048"},"html":{"href":"https://github.com/vivo-project/Vitro/pull/80#discussion_r227961048"},"pull_request":{"href":"https://api.github.com/repos/vivo-project/Vitro/pulls/80"}}},"pull_request":{"url":"https://api.github.com/repos/vivo-project/Vitro/pulls/80","id":203170665,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzMTcwNjY1","html_url":"https://github.com/vivo-project/Vitro/pull/80","diff_url":"https://github.com/vivo-project/Vitro/pull/80.diff","patch_url":"https://github.com/vivo-project/Vitro/pull/80.patch","issue_url":"https://api.github.com/repos/vivo-project/Vitro/issues/80","number":80,"state":"open","locked":false,"title":"[VIVO-1436] Implementation of Advanced Role Management","user":{"login":"grahamtriggs","id":588135,"node_id":"MDQ6VXNlcjU4ODEzNQ==","avatar_url":"https://avatars0.githubusercontent.com/u/588135?v=4","gravatar_id":"","url":"https://api.github.com/users/grahamtriggs","html_url":"https://github.com/grahamtriggs","followers_url":"https://api.github.com/users/grahamtriggs/followers","following_url":"https://api.github.com/users/grahamtriggs/following{/other_user}","gists_url":"https://api.github.com/users/grahamtriggs/gists{/gist_id}","starred_url":"https://api.github.com/users/grahamtriggs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grahamtriggs/subscriptions","organizations_url":"https://api.github.com/users/grahamtriggs/orgs","repos_url":"https://api.github.com/users/grahamtriggs/repos","events_url":"https://api.github.com/users/grahamtriggs/events{/privacy}","received_events_url":"https://api.github.com/users/grahamtriggs/received_events","type":"User","site_admin":false},"body":"\r\n**[VIVO-1436](https://jira.duraspace.org/browse/VIVO-1436)**: \r\n\r\n# What does this pull request do?\r\nThis pull request provides the framework for permissions to view, edit and publish properties to be assigned discretely to roles, rather than as a hierarchy of super-user > user > public.\r\n\r\n# What's new?\r\nIt replaces the Policy code for granting access to properties such that the roles can be given access to or denied access for properties independent of there being a \"hierarchy\" of roles.\r\n\r\nIt includes a migration startup listener that will take any old policies defined on existing properties, and convert them to the equivalent role permissions.\r\n\r\nThe editing of properties has been updated to provide checkboxes for assigning properties to roles, rather than a drop-down of a role hierarchy.\r\n\r\nProperty permissions are now stored in the User Accounts model, along with the other role and permission settings.\r\n\r\n# How should this be tested?\r\nAfter upgrading, an existing installation should still have the same permissions as before (i.e. the same people should have the same access to view / edit content).\r\n\r\nThe edit pages for the properties should show checkboxes for the permissions granted, and any changes to the permissions should be honoured.\r\n\r\nCreating new properties should default to a \"sensible\" set of checkboxes being already selected (e.g. all view permissions and editors can update).\r\n\r\n# Additional Notes:\r\nDocumentation will need to be updated for the new permissions.\r\nThis should not be merged without also merging the equivalent VIVO pull request.\r\n\r\n# Interested parties\r\n@VIVO-project/vivo-committers\r\n","created_at":"2018-07-23T10:11:17Z","updated_at":"2018-10-24T21:34:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9cd155e63a3394e3e79e7a112f1ef0320b8aa8c6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/vivo-project/Vitro/pulls/80/commits","review_comments_url":"https://api.github.com/repos/vivo-project/Vitro/pulls/80/comments","review_comment_url":"https://api.github.com/repos/vivo-project/Vitro/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vivo-project/Vitro/issues/80/comments","statuses_url":"https://api.github.com/repos/vivo-project/Vitro/statuses/5d5bab532ae82a0100ff3b1c07913c9e5687845d","head":{"label":"grahamtriggs:feature/arm","ref":"feature/arm","sha":"5d5bab532ae82a0100ff3b1c07913c9e5687845d","user":{"login":"grahamtriggs","id":588135,"node_id":"MDQ6VXNlcjU4ODEzNQ==","avatar_url":"https://avatars0.githubusercontent.com/u/588135?v=4","gravatar_id":"","url":"https://api.github.com/users/grahamtriggs","html_url":"https://github.com/grahamtriggs","followers_url":"https://api.github.com/users/grahamtriggs/followers","following_url":"https://api.github.com/users/grahamtriggs/following{/other_user}","gists_url":"https://api.github.com/users/grahamtriggs/gists{/gist_id}","starred_url":"https://api.github.com/users/grahamtriggs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grahamtriggs/subscriptions","organizations_url":"https://api.github.com/users/grahamtriggs/orgs","repos_url":"https://api.github.com/users/grahamtriggs/repos","events_url":"https://api.github.com/users/grahamtriggs/events{/privacy}","received_events_url":"https://api.github.com/users/grahamtriggs/received_events","type":"User","site_admin":false},"repo":{"id":25917366,"node_id":"MDEwOlJlcG9zaXRvcnkyNTkxNzM2Ng==","name":"Vitro","full_name":"grahamtriggs/Vitro","private":false,"owner":{"login":"grahamtriggs","id":588135,"node_id":"MDQ6VXNlcjU4ODEzNQ==","avatar_url":"https://avatars0.githubusercontent.com/u/588135?v=4","gravatar_id":"","url":"https://api.github.com/users/grahamtriggs","html_url":"https://github.com/grahamtriggs","followers_url":"https://api.github.com/users/grahamtriggs/followers","following_url":"https://api.github.com/users/grahamtriggs/following{/other_user}","gists_url":"https://api.github.com/users/grahamtriggs/gists{/gist_id}","starred_url":"https://api.github.com/users/grahamtriggs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grahamtriggs/subscriptions","organizations_url":"https://api.github.com/users/grahamtriggs/orgs","repos_url":"https://api.github.com/users/grahamtriggs/repos","events_url":"https://api.github.com/users/grahamtriggs/events{/privacy}","received_events_url":"https://api.github.com/users/grahamtriggs/received_events","type":"User","site_admin":false},"html_url":"https://github.com/grahamtriggs/Vitro","description":"Vitro is a \"full stack\" framework for building semantic web applications. It is not domain specific.","fork":true,"url":"https://api.github.com/repos/grahamtriggs/Vitro","forks_url":"https://api.github.com/repos/grahamtriggs/Vitro/forks","keys_url":"https://api.github.com/repos/grahamtriggs/Vitro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grahamtriggs/Vitro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grahamtriggs/Vitro/teams","hooks_url":"https://api.github.com/repos/grahamtriggs/Vitro/hooks","issue_events_url":"https://api.github.com/repos/grahamtriggs/Vitro/issues/events{/number}","events_url":"https://api.github.com/repos/grahamtriggs/Vitro/events","assignees_url":"https://api.github.com/repos/grahamtriggs/Vitro/assignees{/user}","branches_url":"https://api.github.com/repos/grahamtriggs/Vitro/branches{/branch}","tags_url":"https://api.github.com/repos/grahamtriggs/Vitro/tags","blobs_url":"https://api.github.com/repos/grahamtriggs/Vitro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grahamtriggs/Vitro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grahamtriggs/Vitro/git/refs{/sha}","trees_url":"https://api.github.com/repos/grahamtriggs/Vitro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grahamtriggs/Vitro/statuses/{sha}","languages_url":"https://api.github.com/repos/grahamtriggs/Vitro/languages","stargazers_url":"https://api.github.com/repos/grahamtriggs/Vitro/stargazers","contributors_url":"https://api.github.com/repos/grahamtriggs/Vitro/contributors","subscribers_url":"https://api.github.com/repos/grahamtriggs/Vitro/subscribers","subscription_url":"https://api.github.com/repos/grahamtriggs/Vitro/subscription","commits_url":"https://api.github.com/repos/grahamtriggs/Vitro/commits{/sha}","git_commits_url":"https://api.github.com/repos/grahamtriggs/Vitro/git/commits{/sha}","comments_url":"https://api.github.com/repos/grahamtriggs/Vitro/comments{/number}","issue_comment_url":"https://api.github.com/repos/grahamtriggs/Vitro/issues/comments{/number}","contents_url":"https://api.github.com/repos/grahamtriggs/Vitro/contents/{+path}","compare_url":"https://api.github.com/repos/grahamtriggs/Vitro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grahamtriggs/Vitro/merges","archive_url":"https://api.github.com/repos/grahamtriggs/Vitro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grahamtriggs/Vitro/downloads","issues_url":"https://api.github.com/repos/grahamtriggs/Vitro/issues{/number}","pulls_url":"https://api.github.com/repos/grahamtriggs/Vitro/pulls{/number}","milestones_url":"https://api.github.com/repos/grahamtriggs/Vitro/milestones{/number}","notifications_url":"https://api.github.com/repos/grahamtriggs/Vitro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grahamtriggs/Vitro/labels{/name}","releases_url":"https://api.github.com/repos/grahamtriggs/Vitro/releases{/id}","deployments_url":"https://api.github.com/repos/grahamtriggs/Vitro/deployments","created_at":"2014-10-29T11:17:29Z","updated_at":"2018-08-22T10:56:47Z","pushed_at":"2018-10-20T07:17:32Z","git_url":"git://github.com/grahamtriggs/Vitro.git","ssh_url":"git@github.com:grahamtriggs/Vitro.git","clone_url":"https://github.com/grahamtriggs/Vitro.git","svn_url":"https://github.com/grahamtriggs/Vitro","homepage":"","size":276331,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"vivo-project:develop","ref":"develop","sha":"f2656ba3d8ae67359567d5aecd92eb67ba743c62","user":{"login":"vivo-project","id":1489712,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0ODk3MTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1489712?v=4","gravatar_id":"","url":"https://api.github.com/users/vivo-project","html_url":"https://github.com/vivo-project","followers_url":"https://api.github.com/users/vivo-project/followers","following_url":"https://api.github.com/users/vivo-project/following{/other_user}","gists_url":"https://api.github.com/users/vivo-project/gists{/gist_id}","starred_url":"https://api.github.com/users/vivo-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vivo-project/subscriptions","organizations_url":"https://api.github.com/users/vivo-project/orgs","repos_url":"https://api.github.com/users/vivo-project/repos","events_url":"https://api.github.com/users/vivo-project/events{/privacy}","received_events_url":"https://api.github.com/users/vivo-project/received_events","type":"Organization","site_admin":false},"repo":{"id":6448810,"node_id":"MDEwOlJlcG9zaXRvcnk2NDQ4ODEw","name":"Vitro","full_name":"vivo-project/Vitro","private":false,"owner":{"login":"vivo-project","id":1489712,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0ODk3MTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1489712?v=4","gravatar_id":"","url":"https://api.github.com/users/vivo-project","html_url":"https://github.com/vivo-project","followers_url":"https://api.github.com/users/vivo-project/followers","following_url":"https://api.github.com/users/vivo-project/following{/other_user}","gists_url":"https://api.github.com/users/vivo-project/gists{/gist_id}","starred_url":"https://api.github.com/users/vivo-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vivo-project/subscriptions","organizations_url":"https://api.github.com/users/vivo-project/orgs","repos_url":"https://api.github.com/users/vivo-project/repos","events_url":"https://api.github.com/users/vivo-project/events{/privacy}","received_events_url":"https://api.github.com/users/vivo-project/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/vivo-project/Vitro","description":"Vitro is a \"full stack\" framework for building semantic web applications. It is not domain specific.","fork":false,"url":"https://api.github.com/repos/vivo-project/Vitro","forks_url":"https://api.github.com/repos/vivo-project/Vitro/forks","keys_url":"https://api.github.com/repos/vivo-project/Vitro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vivo-project/Vitro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vivo-project/Vitro/teams","hooks_url":"https://api.github.com/repos/vivo-project/Vitro/hooks","issue_events_url":"https://api.github.com/repos/vivo-project/Vitro/issues/events{/number}","events_url":"https://api.github.com/repos/vivo-project/Vitro/events","assignees_url":"https://api.github.com/repos/vivo-project/Vitro/assignees{/user}","branches_url":"https://api.github.com/repos/vivo-project/Vitro/branches{/branch}","tags_url":"https://api.github.com/repos/vivo-project/Vitro/tags","blobs_url":"https://api.github.com/repos/vivo-project/Vitro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vivo-project/Vitro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vivo-project/Vitro/git/refs{/sha}","trees_url":"https://api.github.com/repos/vivo-project/Vitro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vivo-project/Vitro/statuses/{sha}","languages_url":"https://api.github.com/repos/vivo-project/Vitro/languages","stargazers_url":"https://api.github.com/repos/vivo-project/Vitro/stargazers","contributors_url":"https://api.github.com/repos/vivo-project/Vitro/contributors","subscribers_url":"https://api.github.com/repos/vivo-project/Vitro/subscribers","subscription_url":"https://api.github.com/repos/vivo-project/Vitro/subscription","commits_url":"https://api.github.com/repos/vivo-project/Vitro/commits{/sha}","git_commits_url":"https://api.github.com/repos/vivo-project/Vitro/git/commits{/sha}","comments_url":"https://api.github.com/repos/vivo-project/Vitro/comments{/number}","issue_comment_url":"https://api.github.com/repos/vivo-project/Vitro/issues/comments{/number}","contents_url":"https://api.github.com/repos/vivo-project/Vitro/contents/{+path}","compare_url":"https://api.github.com/repos/vivo-project/Vitro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vivo-project/Vitro/merges","archive_url":"https://api.github.com/repos/vivo-project/Vitro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vivo-project/Vitro/downloads","issues_url":"https://api.github.com/repos/vivo-project/Vitro/issues{/number}","pulls_url":"https://api.github.com/repos/vivo-project/Vitro/pulls{/number}","milestones_url":"https://api.github.com/repos/vivo-project/Vitro/milestones{/number}","notifications_url":"https://api.github.com/repos/vivo-project/Vitro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vivo-project/Vitro/labels{/name}","releases_url":"https://api.github.com/repos/vivo-project/Vitro/releases{/id}","deployments_url":"https://api.github.com/repos/vivo-project/Vitro/deployments","created_at":"2012-10-29T22:40:44Z","updated_at":"2018-10-16T13:42:35Z","pushed_at":"2018-10-20T07:36:18Z","git_url":"git://github.com/vivo-project/Vitro.git","ssh_url":"git@github.com:vivo-project/Vitro.git","clone_url":"https://github.com/vivo-project/Vitro.git","svn_url":"https://github.com/vivo-project/Vitro","homepage":"","size":276688,"stargazers_count":54,"watchers_count":54,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":58,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":58,"open_issues":7,"watchers":54,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/vivo-project/Vitro/pulls/80"},"html":{"href":"https://github.com/vivo-project/Vitro/pull/80"},"issue":{"href":"https://api.github.com/repos/vivo-project/Vitro/issues/80"},"comments":{"href":"https://api.github.com/repos/vivo-project/Vitro/issues/80/comments"},"review_comments":{"href":"https://api.github.com/repos/vivo-project/Vitro/pulls/80/comments"},"review_comment":{"href":"https://api.github.com/repos/vivo-project/Vitro/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vivo-project/Vitro/pulls/80/commits"},"statuses":{"href":"https://api.github.com/repos/vivo-project/Vitro/statuses/5d5bab532ae82a0100ff3b1c07913c9e5687845d"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"awoods"}}