GitHub PullRequestReviewCommentEvent at 2014-12-02 07:07:33
Repository: h
Actor: tilgovi
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/hypothesis/h/pulls/comments/21142877","id":21142877,"diff_hunk":"@@ -0,0 +1,87 @@\n+privacy = ['$window', ($window) ->\n+  VISIBILITY_KEY ='hypothesis.visibility'\n+  VISIBILITY_PUBLIC = 'public'","path":"h/static/scripts/directives/privacy.coffee","position":3,"original_position":3,"commit_id":"7524a17892cc9f64622ad504352da444a84ddc81","original_commit_id":"bcd0083c4b2b30b40d657bbb7c10aaf1006e8b97","user":{"login":"tilgovi","id":20818,"avatar_url":"https://avatars.githubusercontent.com/u/20818?v=3","gravatar_id":"","url":"https://api.github.com/users/tilgovi","html_url":"https://github.com/tilgovi","followers_url":"https://api.github.com/users/tilgovi/followers","following_url":"https://api.github.com/users/tilgovi/following{/other_user}","gists_url":"https://api.github.com/users/tilgovi/gists{/gist_id}","starred_url":"https://api.github.com/users/tilgovi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tilgovi/subscriptions","organizations_url":"https://api.github.com/users/tilgovi/orgs","repos_url":"https://api.github.com/users/tilgovi/repos","events_url":"https://api.github.com/users/tilgovi/events{/privacy}","received_events_url":"https://api.github.com/users/tilgovi/received_events","type":"User","site_admin":false},"body":"Okay. What do you think? I've made a PR against this one (#1741). As far as I can tell, nothing else needs to be done for this and it's ready to merge.","created_at":"2014-12-02T07:07:33Z","updated_at":"2014-12-02T07:07:33Z","html_url":"https://github.com/hypothesis/h/pull/1727#discussion_r21142877","pull_request_url":"https://api.github.com/repos/hypothesis/h/pulls/1727","_links":{"self":{"href":"https://api.github.com/repos/hypothesis/h/pulls/comments/21142877"},"html":{"href":"https://github.com/hypothesis/h/pull/1727#discussion_r21142877"},"pull_request":{"href":"https://api.github.com/repos/hypothesis/h/pulls/1727"}}},"pull_request":{"url":"https://api.github.com/repos/hypothesis/h/pulls/1727","id":25160379,"html_url":"https://github.com/hypothesis/h/pull/1727","diff_url":"https://github.com/hypothesis/h/pull/1727.diff","patch_url":"https://github.com/hypothesis/h/pull/1727.patch","issue_url":"https://api.github.com/repos/hypothesis/h/issues/1727","number":1727,"state":"open","locked":false,"title":"[WIP] Sticky privacy on the browser","user":{"login":"gergely-ujvari","id":2094134,"avatar_url":"https://avatars.githubusercontent.com/u/2094134?v=3","gravatar_id":"","url":"https://api.github.com/users/gergely-ujvari","html_url":"https://github.com/gergely-ujvari","followers_url":"https://api.github.com/users/gergely-ujvari/followers","following_url":"https://api.github.com/users/gergely-ujvari/following{/other_user}","gists_url":"https://api.github.com/users/gergely-ujvari/gists{/gist_id}","starred_url":"https://api.github.com/users/gergely-ujvari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gergely-ujvari/subscriptions","organizations_url":"https://api.github.com/users/gergely-ujvari/orgs","repos_url":"https://api.github.com/users/gergely-ujvari/repos","events_url":"https://api.github.com/users/gergely-ujvari/events{/privacy}","received_events_url":"https://api.github.com/users/gergely-ujvari/received_events","type":"User","site_admin":false},"body":"Following @aron's idea I open this PR to get the best of both #1714 and #1716 \r\n\r\nIt does the following:\r\n- The permission plugin no longer sets the permissions\r\n- Because of this the read permission can be a one-item list for public annotations too: `[\"group:__world__\"]` instead of `[\"group:__world__\", <username>\"`\r\n- Privacy directive moved from `directives.coffee` to `directives/privacy.coffee`\r\n- It uses the simple localStorage solution instead of angular-cache but not as a service, but as just some private functions for the privacy directive.\r\n\r\nWhat is not nice:\r\n- I've kept the visibility constants from the my branch but actually it looks rather stupid to store them in the localStorage and convert them to the appropriate privacy levels string\r\n- I do not know how to get rid of the `privacy-default` variable. The directive does know nothing about the annotation and it is the only way to feed it with annotation data\r\n- When we create a reply we have manually adjust its permissions, because there is no way inside the directive to read the parents permissions. Maybe, we could do this by including the annotator service inside the directive and use annotator.threading.getContainer .. something.. but that is overkill.\r\n\r\nQuestions:\r\n- Was there any other reason to have the user in the `permissions.read` besides the permissions plugin?\r\n- How can I reach the logged in user from the privacy directive? (Currently I'm just simply using annotation.user)\r\n\r\nSo thoughts are welcome. This is WIP, anything can change.","created_at":"2014-11-27T16:15:24Z","updated_at":"2014-12-02T07:07:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cbe330f7b2363cbd2ffd193bcc714c5521c6cae1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hypothesis/h/pulls/1727/commits","review_comments_url":"https://api.github.com/repos/hypothesis/h/pulls/1727/comments","review_comment_url":"https://api.github.com/repos/hypothesis/h/pulls/comments/{number}","comments_url":"https://api.github.com/repos/hypothesis/h/issues/1727/comments","statuses_url":"https://api.github.com/repos/hypothesis/h/statuses/7524a17892cc9f64622ad504352da444a84ddc81","head":{"label":"hypothesis:sticky-visibility-setting-alt-2","ref":"sticky-visibility-setting-alt-2","sha":"7524a17892cc9f64622ad504352da444a84ddc81","user":{"login":"hypothesis","id":1243215,"avatar_url":"https://avatars.githubusercontent.com/u/1243215?v=3","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"repo":{"id":3910945,"name":"h","full_name":"hypothesis/h","owner":{"login":"hypothesis","id":1243215,"avatar_url":"https://avatars.githubusercontent.com/u/1243215?v=3","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hypothesis/h","description":"The Internet, peer reviewed.","fork":false,"url":"https://api.github.com/repos/hypothesis/h","forks_url":"https://api.github.com/repos/hypothesis/h/forks","keys_url":"https://api.github.com/repos/hypothesis/h/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hypothesis/h/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hypothesis/h/teams","hooks_url":"https://api.github.com/repos/hypothesis/h/hooks","issue_events_url":"https://api.github.com/repos/hypothesis/h/issues/events{/number}","events_url":"https://api.github.com/repos/hypothesis/h/events","assignees_url":"https://api.github.com/repos/hypothesis/h/assignees{/user}","branches_url":"https://api.github.com/repos/hypothesis/h/branches{/branch}","tags_url":"https://api.github.com/repos/hypothesis/h/tags","blobs_url":"https://api.github.com/repos/hypothesis/h/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hypothesis/h/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hypothesis/h/git/refs{/sha}","trees_url":"https://api.github.com/repos/hypothesis/h/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hypothesis/h/statuses/{sha}","languages_url":"https://api.github.com/repos/hypothesis/h/languages","stargazers_url":"https://api.github.com/repos/hypothesis/h/stargazers","contributors_url":"https://api.github.com/repos/hypothesis/h/contributors","subscribers_url":"https://api.github.com/repos/hypothesis/h/subscribers","subscription_url":"https://api.github.com/repos/hypothesis/h/subscription","commits_url":"https://api.github.com/repos/hypothesis/h/commits{/sha}","git_commits_url":"https://api.github.com/repos/hypothesis/h/git/commits{/sha}","comments_url":"https://api.github.com/repos/hypothesis/h/comments{/number}","issue_comment_url":"https://api.github.com/repos/hypothesis/h/issues/comments/{number}","contents_url":"https://api.github.com/repos/hypothesis/h/contents/{+path}","compare_url":"https://api.github.com/repos/hypothesis/h/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hypothesis/h/merges","archive_url":"https://api.github.com/repos/hypothesis/h/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hypothesis/h/downloads","issues_url":"https://api.github.com/repos/hypothesis/h/issues{/number}","pulls_url":"https://api.github.com/repos/hypothesis/h/pulls{/number}","milestones_url":"https://api.github.com/repos/hypothesis/h/milestones{/number}","notifications_url":"https://api.github.com/repos/hypothesis/h/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hypothesis/h/labels{/name}","releases_url":"https://api.github.com/repos/hypothesis/h/releases{/id}","created_at":"2012-04-02T19:56:59Z","updated_at":"2014-12-01T22:11:00Z","pushed_at":"2014-12-02T07:06:31Z","git_url":"git://github.com/hypothesis/h.git","ssh_url":"git@github.com:hypothesis/h.git","clone_url":"https://github.com/hypothesis/h.git","svn_url":"https://github.com/hypothesis/h","homepage":"https://hypothes.is/","size":55030,"stargazers_count":351,"watchers_count":351,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":92,"mirror_url":null,"open_issues_count":145,"forks":92,"open_issues":145,"watchers":351,"default_branch":"master"}},"base":{"label":"hypothesis:master","ref":"master","sha":"3a21d8f434522228e38117b5116c2e5ebe7fc99a","user":{"login":"hypothesis","id":1243215,"avatar_url":"https://avatars.githubusercontent.com/u/1243215?v=3","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"repo":{"id":3910945,"name":"h","full_name":"hypothesis/h","owner":{"login":"hypothesis","id":1243215,"avatar_url":"https://avatars.githubusercontent.com/u/1243215?v=3","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hypothesis/h","description":"The Internet, peer reviewed.","fork":false,"url":"https://api.github.com/repos/hypothesis/h","forks_url":"https://api.github.com/repos/hypothesis/h/forks","keys_url":"https://api.github.com/repos/hypothesis/h/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hypothesis/h/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hypothesis/h/teams","hooks_url":"https://api.github.com/repos/hypothesis/h/hooks","issue_events_url":"https://api.github.com/repos/hypothesis/h/issues/events{/number}","events_url":"https://api.github.com/repos/hypothesis/h/events","assignees_url":"https://api.github.com/repos/hypothesis/h/assignees{/user}","branches_url":"https://api.github.com/repos/hypothesis/h/branches{/branch}","tags_url":"https://api.github.com/repos/hypothesis/h/tags","blobs_url":"https://api.github.com/repos/hypothesis/h/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hypothesis/h/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hypothesis/h/git/refs{/sha}","trees_url":"https://api.github.com/repos/hypothesis/h/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hypothesis/h/statuses/{sha}","languages_url":"https://api.github.com/repos/hypothesis/h/languages","stargazers_url":"https://api.github.com/repos/hypothesis/h/stargazers","contributors_url":"https://api.github.com/repos/hypothesis/h/contributors","subscribers_url":"https://api.github.com/repos/hypothesis/h/subscribers","subscription_url":"https://api.github.com/repos/hypothesis/h/subscription","commits_url":"https://api.github.com/repos/hypothesis/h/commits{/sha}","git_commits_url":"https://api.github.com/repos/hypothesis/h/git/commits{/sha}","comments_url":"https://api.github.com/repos/hypothesis/h/comments{/number}","issue_comment_url":"https://api.github.com/repos/hypothesis/h/issues/comments/{number}","contents_url":"https://api.github.com/repos/hypothesis/h/contents/{+path}","compare_url":"https://api.github.com/repos/hypothesis/h/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hypothesis/h/merges","archive_url":"https://api.github.com/repos/hypothesis/h/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hypothesis/h/downloads","issues_url":"https://api.github.com/repos/hypothesis/h/issues{/number}","pulls_url":"https://api.github.com/repos/hypothesis/h/pulls{/number}","milestones_url":"https://api.github.com/repos/hypothesis/h/milestones{/number}","notifications_url":"https://api.github.com/repos/hypothesis/h/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hypothesis/h/labels{/name}","releases_url":"https://api.github.com/repos/hypothesis/h/releases{/id}","created_at":"2012-04-02T19:56:59Z","updated_at":"2014-12-01T22:11:00Z","pushed_at":"2014-12-02T07:06:31Z","git_url":"git://github.com/hypothesis/h.git","ssh_url":"git@github.com:hypothesis/h.git","clone_url":"https://github.com/hypothesis/h.git","svn_url":"https://github.com/hypothesis/h","homepage":"https://hypothes.is/","size":55030,"stargazers_count":351,"watchers_count":351,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":92,"mirror_url":null,"open_issues_count":145,"forks":92,"open_issues":145,"watchers":351,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hypothesis/h/pulls/1727"},"html":{"href":"https://github.com/hypothesis/h/pull/1727"},"issue":{"href":"https://api.github.com/repos/hypothesis/h/issues/1727"},"comments":{"href":"https://api.github.com/repos/hypothesis/h/issues/1727/comments"},"review_comments":{"href":"https://api.github.com/repos/hypothesis/h/pulls/1727/comments"},"review_comment":{"href":"https://api.github.com/repos/hypothesis/h/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/hypothesis/h/pulls/1727/commits"},"statuses":{"href":"https://api.github.com/repos/hypothesis/h/statuses/7524a17892cc9f64622ad504352da444a84ddc81"}}}}