{"action":"created","comment":{"url":"https://api.github.com/repos/4teamwork/opengever.core/pulls/comments/205401314","pull_request_review_id":140661106,"id":205401314,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTQwMTMxNA==","diff_hunk":"@@ -0,0 +1,84 @@\n+var app = new Vue({\n+  template: '#sharing-form',\n+  el: '#sharing-view-vue-app',\n+  data: {\n+    userid: null,\n+    i18n: {},\n+    context_url:null,\n+    endpoint: null,\n+    available_roles: [],\n+    entries: [],\n+    inherit: null,\n+    authtoken: null,\n+    requester: null,\n+    principal_search: null,\n+  },\n+\n+  beforeMount: function () {\n+    this.context_url = this.$el.attributes['data-contexturl'].value;\n+    this.portal_url = this.$el.attributes['data-portalurl'].value;\n+    this.endpoint = this.context_url + '/@sharing';\n+    this.i18n = JSON.parse(this.$el.attributes['data-i18n'].value);\n+    this.authtoken = this.$el.attributes['data-authtoken'].value;\n+\n+    var requester = axios.create();\n+    requester.defaults.headers.common['Accept'] = 'application/json';\n+    requester.defaults.headers.common['Content-Type'] = 'application/json';\n+    this.requester = requester;\n+  },\n+\n+  mounted: function () {\n+    this.fetchData();\n+  },\n+\n+  methods: {\n+    errorMessage: function (){\n+      return this.messenger.shout([{\n+        'messageTitle': this.i18n.message_title,\n+        'message': this.i18n.message_not_saved, 'messageClass': 'error'}]);\n+    },\n+\n+    fetchData: function () {\n+      // make sure IE 11 does not cache the fetch request\n+      var params = { _t: Date.now().toString()};\n+      this.requester.get(this.endpoint, { params: params }).then(function (response) {\n+        this.available_roles = response.data['available_roles'];\n+        this.entries = response.data['entries'];\n+        this.inherit = response.data['inherit'];\n+\n+      }.bind(this));\n+    },\n+\n+    toggle_checkbox: function (event, entry, role) {\n+      var checkbox = event.target;\n+      entry.roles[role] = checkbox.checked;\n+      entry.disabled = false;","path":"opengever/sharing/browser/resources/sharing.js","position":null,"original_position":55,"commit_id":"878a2370e5d5f0602327bc59fd65a814c1a9373e","original_commit_id":"caa62416a625a197e8e58bb38918e7024d3b3cee","user":{"login":"lukasgraf","id":405124,"node_id":"MDQ6VXNlcjQwNTEyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/405124?v=4","gravatar_id":"","url":"https://api.github.com/users/lukasgraf","html_url":"https://github.com/lukasgraf","followers_url":"https://api.github.com/users/lukasgraf/followers","following_url":"https://api.github.com/users/lukasgraf/following{/other_user}","gists_url":"https://api.github.com/users/lukasgraf/gists{/gist_id}","starred_url":"https://api.github.com/users/lukasgraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukasgraf/subscriptions","organizations_url":"https://api.github.com/users/lukasgraf/orgs","repos_url":"https://api.github.com/users/lukasgraf/repos","events_url":"https://api.github.com/users/lukasgraf/events{/privacy}","received_events_url":"https://api.github.com/users/lukasgraf/received_events","type":"User","site_admin":false},"body":"As discussed: `entry.disabled` is probably not needed anymore. Double-check (`search()` still does something with it), and maybe remove.","created_at":"2018-07-26T10:06:25Z","updated_at":"2018-07-26T10:06:25Z","html_url":"https://github.com/4teamwork/opengever.core/pull/4551#discussion_r205401314","pull_request_url":"https://api.github.com/repos/4teamwork/opengever.core/pulls/4551","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/4teamwork/opengever.core/pulls/comments/205401314"},"html":{"href":"https://github.com/4teamwork/opengever.core/pull/4551#discussion_r205401314"},"pull_request":{"href":"https://api.github.com/repos/4teamwork/opengever.core/pulls/4551"}},"in_reply_to_id":202293171},"pull_request":{"url":"https://api.github.com/repos/4teamwork/opengever.core/pulls/4551","id":199668440,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5NjY4NDQw","html_url":"https://github.com/4teamwork/opengever.core/pull/4551","diff_url":"https://github.com/4teamwork/opengever.core/pull/4551.diff","patch_url":"https://github.com/4teamwork/opengever.core/pull/4551.patch","issue_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/4551","number":4551,"state":"open","locked":false,"title":"Add RoleAssignment manager layer","user":{"login":"phgross","id":485755,"node_id":"MDQ6VXNlcjQ4NTc1NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/485755?v=4","gravatar_id":"","url":"https://api.github.com/users/phgross","html_url":"https://github.com/phgross","followers_url":"https://api.github.com/users/phgross/followers","following_url":"https://api.github.com/users/phgross/following{/other_user}","gists_url":"https://api.github.com/users/phgross/gists{/gist_id}","starred_url":"https://api.github.com/users/phgross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phgross/subscriptions","organizations_url":"https://api.github.com/users/phgross/orgs","repos_url":"https://api.github.com/users/phgross/repos","events_url":"https://api.github.com/users/phgross/events{/privacy}","received_events_url":"https://api.github.com/users/phgross/received_events","type":"User","site_admin":false},"body":"This PR adds an additional layer, the `RoleAssigmentManager` which handles all local_role assignments. It stores every local_role assignment as a separate entry in his own storage (annotations) including the cause and a reference to another object in some cases. This offers the possibility to display the reason, why a user is permitted on an object or remove a temporary permission on a document, after a task gets closed for example (as specified in OGIP 45).\r\n\r\n### Patching\r\nTo make sure that the RoleAssignment Layer is not bypassed by some functionality which directly adds or removes local_roles, I patched the `manage_*` methods from the `OFS.role.RoleManager` and extend them with a `verified` check. This patch does not protect from direct writes on the `__ac_local_roles__`, therefore I double checked all property writes (see https://gist.github.com/phgross/ffcb508de469d485ec7334918d0f0a29). Because the owner Role is set on different places by directly setting the `__ac_local_roles__` property and can't be manually triggered by any functionality in GEVER, we decided to exclude the `Owner` Role from the RoleAssignment Manager. \r\n\r\n### Assignments\r\nThe following functionalities are handled\r\n - Sharing form adjustments \r\n - Local roles for Task responsibles and responsible-agency \r\n - Dossier protection (\"Dossier schützen\")\r\n - Workspace invitation\r\n - Committee Group\r\n - Repository generation\r\n\r\n### sharing form\r\nDuring the implementation I realized that the current plone implementation of the sharing form, brings some bad UX-fails and extending it with some more functionality (display assignments) will be quite hard. Therefore I decided to replace the Form with a VueJS App, communicating with the already existing `@sharing` endpoints from plone.restapi. \r\n\r\nLook and Feel is still similar to the former implementation of the form, but it now offers the possibility to check why a user/group has some roles, by clicking on the question-mark, which lists all assignments for a use or group:\r\n\r\n![sharing form](https://user-images.githubusercontent.com/485755/42362784-2c2ae158-80f5-11e8-9cb9-8936148fcab0.gif)\r\n\r\n### Info Tab\r\nThe info tab also displays the sharing JS form, but in a readonly mode and with disabled permission-checks.\r\n\r\n### Migration \r\nThe PR contains an upgradestep which migrate the existing local_roles to RoleAssigments for every existing object. Because we're not able do reproduce/decide why a prinicipal has local roles, we migrate all assignments as SharingAssignments (`Manuelle Freigabe`).\r\n\r\nImplemented appropriate to the specification in [OGIP 45](https://gever.4teamwork.ch/ordnungssystem/3/2/2/5/dossier-2628/document-23855)\r\n","created_at":"2018-07-06T07:38:51Z","updated_at":"2018-07-26T10:06:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b0e202f3923970d75872da0ad785e4fb52c7be4a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/4teamwork/opengever.core/milestones/47","html_url":"https://github.com/4teamwork/opengever.core/milestone/47","labels_url":"https://api.github.com/repos/4teamwork/opengever.core/milestones/47/labels","id":3205948,"node_id":"MDk6TWlsZXN0b25lMzIwNTk0OA==","number":47,"title":"Release 2018.4","description":"","creator":{"login":"deiferni","id":736583,"node_id":"MDQ6VXNlcjczNjU4Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/736583?v=4","gravatar_id":"","url":"https://api.github.com/users/deiferni","html_url":"https://github.com/deiferni","followers_url":"https://api.github.com/users/deiferni/followers","following_url":"https://api.github.com/users/deiferni/following{/other_user}","gists_url":"https://api.github.com/users/deiferni/gists{/gist_id}","starred_url":"https://api.github.com/users/deiferni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deiferni/subscriptions","organizations_url":"https://api.github.com/users/deiferni/orgs","repos_url":"https://api.github.com/users/deiferni/repos","events_url":"https://api.github.com/users/deiferni/events{/privacy}","received_events_url":"https://api.github.com/users/deiferni/received_events","type":"User","site_admin":false},"open_issues":23,"closed_issues":248,"state":"open","created_at":"2018-03-21T10:54:15Z","updated_at":"2018-07-26T08:30:40Z","due_on":"2018-08-10T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/4teamwork/opengever.core/pulls/4551/commits","review_comments_url":"https://api.github.com/repos/4teamwork/opengever.core/pulls/4551/comments","review_comment_url":"https://api.github.com/repos/4teamwork/opengever.core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/4551/comments","statuses_url":"https://api.github.com/repos/4teamwork/opengever.core/statuses/878a2370e5d5f0602327bc59fd65a814c1a9373e","head":{"label":"4teamwork:pg_ogip45_role_assignments","ref":"pg_ogip45_role_assignments","sha":"878a2370e5d5f0602327bc59fd65a814c1a9373e","user":{"login":"4teamwork","id":681821,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4MTgyMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/681821?v=4","gravatar_id":"","url":"https://api.github.com/users/4teamwork","html_url":"https://github.com/4teamwork","followers_url":"https://api.github.com/users/4teamwork/followers","following_url":"https://api.github.com/users/4teamwork/following{/other_user}","gists_url":"https://api.github.com/users/4teamwork/gists{/gist_id}","starred_url":"https://api.github.com/users/4teamwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4teamwork/subscriptions","organizations_url":"https://api.github.com/users/4teamwork/orgs","repos_url":"https://api.github.com/users/4teamwork/repos","events_url":"https://api.github.com/users/4teamwork/events{/privacy}","received_events_url":"https://api.github.com/users/4teamwork/received_events","type":"Organization","site_admin":false},"repo":{"id":9788097,"node_id":"MDEwOlJlcG9zaXRvcnk5Nzg4MDk3","name":"opengever.core","full_name":"4teamwork/opengever.core","owner":{"login":"4teamwork","id":681821,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4MTgyMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/681821?v=4","gravatar_id":"","url":"https://api.github.com/users/4teamwork","html_url":"https://github.com/4teamwork","followers_url":"https://api.github.com/users/4teamwork/followers","following_url":"https://api.github.com/users/4teamwork/following{/other_user}","gists_url":"https://api.github.com/users/4teamwork/gists{/gist_id}","starred_url":"https://api.github.com/users/4teamwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4teamwork/subscriptions","organizations_url":"https://api.github.com/users/4teamwork/orgs","repos_url":"https://api.github.com/users/4teamwork/repos","events_url":"https://api.github.com/users/4teamwork/events{/privacy}","received_events_url":"https://api.github.com/users/4teamwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/4teamwork/opengever.core","description":"OneGov GEVER core package","fork":false,"url":"https://api.github.com/repos/4teamwork/opengever.core","forks_url":"https://api.github.com/repos/4teamwork/opengever.core/forks","keys_url":"https://api.github.com/repos/4teamwork/opengever.core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/4teamwork/opengever.core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/4teamwork/opengever.core/teams","hooks_url":"https://api.github.com/repos/4teamwork/opengever.core/hooks","issue_events_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/events{/number}","events_url":"https://api.github.com/repos/4teamwork/opengever.core/events","assignees_url":"https://api.github.com/repos/4teamwork/opengever.core/assignees{/user}","branches_url":"https://api.github.com/repos/4teamwork/opengever.core/branches{/branch}","tags_url":"https://api.github.com/repos/4teamwork/opengever.core/tags","blobs_url":"https://api.github.com/repos/4teamwork/opengever.core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/4teamwork/opengever.core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/4teamwork/opengever.core/git/refs{/sha}","trees_url":"https://api.github.com/repos/4teamwork/opengever.core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/4teamwork/opengever.core/statuses/{sha}","languages_url":"https://api.github.com/repos/4teamwork/opengever.core/languages","stargazers_url":"https://api.github.com/repos/4teamwork/opengever.core/stargazers","contributors_url":"https://api.github.com/repos/4teamwork/opengever.core/contributors","subscribers_url":"https://api.github.com/repos/4teamwork/opengever.core/subscribers","subscription_url":"https://api.github.com/repos/4teamwork/opengever.core/subscription","commits_url":"https://api.github.com/repos/4teamwork/opengever.core/commits{/sha}","git_commits_url":"https://api.github.com/repos/4teamwork/opengever.core/git/commits{/sha}","comments_url":"https://api.github.com/repos/4teamwork/opengever.core/comments{/number}","issue_comment_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/comments{/number}","contents_url":"https://api.github.com/repos/4teamwork/opengever.core/contents/{+path}","compare_url":"https://api.github.com/repos/4teamwork/opengever.core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/4teamwork/opengever.core/merges","archive_url":"https://api.github.com/repos/4teamwork/opengever.core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/4teamwork/opengever.core/downloads","issues_url":"https://api.github.com/repos/4teamwork/opengever.core/issues{/number}","pulls_url":"https://api.github.com/repos/4teamwork/opengever.core/pulls{/number}","milestones_url":"https://api.github.com/repos/4teamwork/opengever.core/milestones{/number}","notifications_url":"https://api.github.com/repos/4teamwork/opengever.core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/4teamwork/opengever.core/labels{/name}","releases_url":"https://api.github.com/repos/4teamwork/opengever.core/releases{/id}","deployments_url":"https://api.github.com/repos/4teamwork/opengever.core/deployments","created_at":"2013-05-01T08:28:16Z","updated_at":"2018-07-26T05:36:11Z","pushed_at":"2018-07-26T10:05:42Z","git_url":"git://github.com/4teamwork/opengever.core.git","ssh_url":"git@github.com:4teamwork/opengever.core.git","clone_url":"https://github.com/4teamwork/opengever.core.git","svn_url":"https://github.com/4teamwork/opengever.core","homepage":"","size":102953,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":232,"license":null,"forks":4,"open_issues":232,"watchers":4,"default_branch":"master"}},"base":{"label":"4teamwork:master","ref":"master","sha":"de243a6313e587fc2cafbf49b7848ae6598a4c7a","user":{"login":"4teamwork","id":681821,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4MTgyMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/681821?v=4","gravatar_id":"","url":"https://api.github.com/users/4teamwork","html_url":"https://github.com/4teamwork","followers_url":"https://api.github.com/users/4teamwork/followers","following_url":"https://api.github.com/users/4teamwork/following{/other_user}","gists_url":"https://api.github.com/users/4teamwork/gists{/gist_id}","starred_url":"https://api.github.com/users/4teamwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4teamwork/subscriptions","organizations_url":"https://api.github.com/users/4teamwork/orgs","repos_url":"https://api.github.com/users/4teamwork/repos","events_url":"https://api.github.com/users/4teamwork/events{/privacy}","received_events_url":"https://api.github.com/users/4teamwork/received_events","type":"Organization","site_admin":false},"repo":{"id":9788097,"node_id":"MDEwOlJlcG9zaXRvcnk5Nzg4MDk3","name":"opengever.core","full_name":"4teamwork/opengever.core","owner":{"login":"4teamwork","id":681821,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4MTgyMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/681821?v=4","gravatar_id":"","url":"https://api.github.com/users/4teamwork","html_url":"https://github.com/4teamwork","followers_url":"https://api.github.com/users/4teamwork/followers","following_url":"https://api.github.com/users/4teamwork/following{/other_user}","gists_url":"https://api.github.com/users/4teamwork/gists{/gist_id}","starred_url":"https://api.github.com/users/4teamwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4teamwork/subscriptions","organizations_url":"https://api.github.com/users/4teamwork/orgs","repos_url":"https://api.github.com/users/4teamwork/repos","events_url":"https://api.github.com/users/4teamwork/events{/privacy}","received_events_url":"https://api.github.com/users/4teamwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/4teamwork/opengever.core","description":"OneGov GEVER core package","fork":false,"url":"https://api.github.com/repos/4teamwork/opengever.core","forks_url":"https://api.github.com/repos/4teamwork/opengever.core/forks","keys_url":"https://api.github.com/repos/4teamwork/opengever.core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/4teamwork/opengever.core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/4teamwork/opengever.core/teams","hooks_url":"https://api.github.com/repos/4teamwork/opengever.core/hooks","issue_events_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/events{/number}","events_url":"https://api.github.com/repos/4teamwork/opengever.core/events","assignees_url":"https://api.github.com/repos/4teamwork/opengever.core/assignees{/user}","branches_url":"https://api.github.com/repos/4teamwork/opengever.core/branches{/branch}","tags_url":"https://api.github.com/repos/4teamwork/opengever.core/tags","blobs_url":"https://api.github.com/repos/4teamwork/opengever.core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/4teamwork/opengever.core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/4teamwork/opengever.core/git/refs{/sha}","trees_url":"https://api.github.com/repos/4teamwork/opengever.core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/4teamwork/opengever.core/statuses/{sha}","languages_url":"https://api.github.com/repos/4teamwork/opengever.core/languages","stargazers_url":"https://api.github.com/repos/4teamwork/opengever.core/stargazers","contributors_url":"https://api.github.com/repos/4teamwork/opengever.core/contributors","subscribers_url":"https://api.github.com/repos/4teamwork/opengever.core/subscribers","subscription_url":"https://api.github.com/repos/4teamwork/opengever.core/subscription","commits_url":"https://api.github.com/repos/4teamwork/opengever.core/commits{/sha}","git_commits_url":"https://api.github.com/repos/4teamwork/opengever.core/git/commits{/sha}","comments_url":"https://api.github.com/repos/4teamwork/opengever.core/comments{/number}","issue_comment_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/comments{/number}","contents_url":"https://api.github.com/repos/4teamwork/opengever.core/contents/{+path}","compare_url":"https://api.github.com/repos/4teamwork/opengever.core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/4teamwork/opengever.core/merges","archive_url":"https://api.github.com/repos/4teamwork/opengever.core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/4teamwork/opengever.core/downloads","issues_url":"https://api.github.com/repos/4teamwork/opengever.core/issues{/number}","pulls_url":"https://api.github.com/repos/4teamwork/opengever.core/pulls{/number}","milestones_url":"https://api.github.com/repos/4teamwork/opengever.core/milestones{/number}","notifications_url":"https://api.github.com/repos/4teamwork/opengever.core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/4teamwork/opengever.core/labels{/name}","releases_url":"https://api.github.com/repos/4teamwork/opengever.core/releases{/id}","deployments_url":"https://api.github.com/repos/4teamwork/opengever.core/deployments","created_at":"2013-05-01T08:28:16Z","updated_at":"2018-07-26T05:36:11Z","pushed_at":"2018-07-26T10:05:42Z","git_url":"git://github.com/4teamwork/opengever.core.git","ssh_url":"git@github.com:4teamwork/opengever.core.git","clone_url":"https://github.com/4teamwork/opengever.core.git","svn_url":"https://github.com/4teamwork/opengever.core","homepage":"","size":102953,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":232,"license":null,"forks":4,"open_issues":232,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/4teamwork/opengever.core/pulls/4551"},"html":{"href":"https://github.com/4teamwork/opengever.core/pull/4551"},"issue":{"href":"https://api.github.com/repos/4teamwork/opengever.core/issues/4551"},"comments":{"href":"https://api.github.com/repos/4teamwork/opengever.core/issues/4551/comments"},"review_comments":{"href":"https://api.github.com/repos/4teamwork/opengever.core/pulls/4551/comments"},"review_comment":{"href":"https://api.github.com/repos/4teamwork/opengever.core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/4teamwork/opengever.core/pulls/4551/commits"},"statuses":{"href":"https://api.github.com/repos/4teamwork/opengever.core/statuses/878a2370e5d5f0602327bc59fd65a814c1a9373e"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"lukasgraf"}}