GitHub PullRequestReviewCommentEvent at 2014-12-23 20:05:17
Repository: nyc-trees
Actor: jwalgran
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/azavea/nyc-trees/pulls/comments/22232125","id":22232125,"diff_hunk":"@@ -29,47 +31,58 @@\n # GROUP ROUTES\n #####################################\n \n-events = is_group_admin(route(GET=v.event_dashboard))\n+events = do(group_admin_request,\n+            route(GET=v.event_dashboard))\n \n-add_event = do(is_group_admin,\n+add_event = do(login_required,\n+               group_admin_request,\n                render_template('event/add_event.html'),\n                route(GET=v.add_event_page,\n                      POST=v.add_event))\n \n-event_detail = route(GET=do(render_template('event/event_detail.html'),\n+event_detail = route(GET=do(group_request,\n+                            render_template('event/event_detail.html'),\n                             v.event_detail),\n-                     DELETE=is_group_admin(v.delete_event))\n+                     DELETE=user_must_be_group_admin(v.delete_event))","path":"src/nyc_trees/apps/event/routes.py","position":31,"original_position":31,"commit_id":"a251432d3c0c55c2094051f8e86bfe004d14bab4","original_commit_id":"d4d8f15957c5cde6395ad5a48d8f2b12b173bad8","user":{"login":"jwalgran","id":17363,"avatar_url":"https://avatars.githubusercontent.com/u/17363?v=3","gravatar_id":"","url":"https://api.github.com/users/jwalgran","html_url":"https://github.com/jwalgran","followers_url":"https://api.github.com/users/jwalgran/followers","following_url":"https://api.github.com/users/jwalgran/following{/other_user}","gists_url":"https://api.github.com/users/jwalgran/gists{/gist_id}","starred_url":"https://api.github.com/users/jwalgran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwalgran/subscriptions","organizations_url":"https://api.github.com/users/jwalgran/orgs","repos_url":"https://api.github.com/users/jwalgran/repos","events_url":"https://api.github.com/users/jwalgran/events{/privacy}","received_events_url":"https://api.github.com/users/jwalgran/received_events","type":"User","site_admin":false},"body":"It is. Fixing.","created_at":"2014-12-23T20:05:17Z","updated_at":"2014-12-23T20:05:17Z","html_url":"https://github.com/azavea/nyc-trees/pull/186#discussion_r22232125","pull_request_url":"https://api.github.com/repos/azavea/nyc-trees/pulls/186","_links":{"self":{"href":"https://api.github.com/repos/azavea/nyc-trees/pulls/comments/22232125"},"html":{"href":"https://github.com/azavea/nyc-trees/pull/186#discussion_r22232125"},"pull_request":{"href":"https://api.github.com/repos/azavea/nyc-trees/pulls/186"}}},"pull_request":{"url":"https://api.github.com/repos/azavea/nyc-trees/pulls/186","id":26492379,"html_url":"https://github.com/azavea/nyc-trees/pull/186","diff_url":"https://github.com/azavea/nyc-trees/pull/186.diff","patch_url":"https://github.com/azavea/nyc-trees/pull/186.patch","issue_url":"https://api.github.com/repos/azavea/nyc-trees/issues/186","number":186,"state":"open","locked":false,"title":"Secure group edit with new decorators","user":{"login":"jwalgran","id":17363,"avatar_url":"https://avatars.githubusercontent.com/u/17363?v=3","gravatar_id":"","url":"https://api.github.com/users/jwalgran","html_url":"https://github.com/jwalgran","followers_url":"https://api.github.com/users/jwalgran/followers","following_url":"https://api.github.com/users/jwalgran/following{/other_user}","gists_url":"https://api.github.com/users/jwalgran/gists{/gist_id}","starred_url":"https://api.github.com/users/jwalgran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwalgran/subscriptions","organizations_url":"https://api.github.com/users/jwalgran/orgs","repos_url":"https://api.github.com/users/jwalgran/repos","events_url":"https://api.github.com/users/jwalgran/events{/privacy}","received_events_url":"https://api.github.com/users/jwalgran/received_events","type":"User","site_admin":false},"body":"This is a large refactor that allows for chainable decorators that decorate the ``request`` with a group object and enforce editability constraints base on the logged in user.\r\n\r\nThe ``group_request`` decorator takes it's cues from the auth context processor. Views wrapped with this decorator will have a ``request.group`` in addition to ``request.user``. This makes for easier composability of decorators and has the side effect of ensuring that the group is only queried once.\r\n\r\nI renamed the existing decorators to make them more forceful. For example ``is_census_admin`` is now ``user_must_be_census_admin`` which is more suggestive of the fact that a view wrapped with this decorator will return 403 Forbidden if the ``request.user`` is not an admin.\r\n\r\nWhile working on the decorators, I also clarified the two different types of training, which grant different levels of page access.","created_at":"2014-12-23T02:02:14Z","updated_at":"2014-12-23T20:05:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"103dd3460eb247dad745775d4f50302622b85952","assignee":{"login":"steventlamb","id":1699455,"avatar_url":"https://avatars.githubusercontent.com/u/1699455?v=3","gravatar_id":"","url":"https://api.github.com/users/steventlamb","html_url":"https://github.com/steventlamb","followers_url":"https://api.github.com/users/steventlamb/followers","following_url":"https://api.github.com/users/steventlamb/following{/other_user}","gists_url":"https://api.github.com/users/steventlamb/gists{/gist_id}","starred_url":"https://api.github.com/users/steventlamb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steventlamb/subscriptions","organizations_url":"https://api.github.com/users/steventlamb/orgs","repos_url":"https://api.github.com/users/steventlamb/repos","events_url":"https://api.github.com/users/steventlamb/events{/privacy}","received_events_url":"https://api.github.com/users/steventlamb/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/azavea/nyc-trees/pulls/186/commits","review_comments_url":"https://api.github.com/repos/azavea/nyc-trees/pulls/186/comments","review_comment_url":"https://api.github.com/repos/azavea/nyc-trees/pulls/comments/{number}","comments_url":"https://api.github.com/repos/azavea/nyc-trees/issues/186/comments","statuses_url":"https://api.github.com/repos/azavea/nyc-trees/statuses/a251432d3c0c55c2094051f8e86bfe004d14bab4","head":{"label":"azavea:feature/jcw/secure-group-pages","ref":"feature/jcw/secure-group-pages","sha":"a251432d3c0c55c2094051f8e86bfe004d14bab4","user":{"login":"azavea","id":595231,"avatar_url":"https://avatars.githubusercontent.com/u/595231?v=3","gravatar_id":"","url":"https://api.github.com/users/azavea","html_url":"https://github.com/azavea","followers_url":"https://api.github.com/users/azavea/followers","following_url":"https://api.github.com/users/azavea/following{/other_user}","gists_url":"https://api.github.com/users/azavea/gists{/gist_id}","starred_url":"https://api.github.com/users/azavea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azavea/subscriptions","organizations_url":"https://api.github.com/users/azavea/orgs","repos_url":"https://api.github.com/users/azavea/repos","events_url":"https://api.github.com/users/azavea/events{/privacy}","received_events_url":"https://api.github.com/users/azavea/received_events","type":"Organization","site_admin":false},"repo":{"id":24998407,"name":"nyc-trees","full_name":"azavea/nyc-trees","owner":{"login":"azavea","id":595231,"avatar_url":"https://avatars.githubusercontent.com/u/595231?v=3","gravatar_id":"","url":"https://api.github.com/users/azavea","html_url":"https://github.com/azavea","followers_url":"https://api.github.com/users/azavea/followers","following_url":"https://api.github.com/users/azavea/following{/other_user}","gists_url":"https://api.github.com/users/azavea/gists{/gist_id}","starred_url":"https://api.github.com/users/azavea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azavea/subscriptions","organizations_url":"https://api.github.com/users/azavea/orgs","repos_url":"https://api.github.com/users/azavea/repos","events_url":"https://api.github.com/users/azavea/events{/privacy}","received_events_url":"https://api.github.com/users/azavea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/azavea/nyc-trees","description":"NYC Parks Trees Count! 2015 tree census","fork":false,"url":"https://api.github.com/repos/azavea/nyc-trees","forks_url":"https://api.github.com/repos/azavea/nyc-trees/forks","keys_url":"https://api.github.com/repos/azavea/nyc-trees/keys{/key_id}","collaborators_url":"https://api.github.com/repos/azavea/nyc-trees/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/azavea/nyc-trees/teams","hooks_url":"https://api.github.com/repos/azavea/nyc-trees/hooks","issue_events_url":"https://api.github.com/repos/azavea/nyc-trees/issues/events{/number}","events_url":"https://api.github.com/repos/azavea/nyc-trees/events","assignees_url":"https://api.github.com/repos/azavea/nyc-trees/assignees{/user}","branches_url":"https://api.github.com/repos/azavea/nyc-trees/branches{/branch}","tags_url":"https://api.github.com/repos/azavea/nyc-trees/tags","blobs_url":"https://api.github.com/repos/azavea/nyc-trees/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/azavea/nyc-trees/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/azavea/nyc-trees/git/refs{/sha}","trees_url":"https://api.github.com/repos/azavea/nyc-trees/git/trees{/sha}","statuses_url":"https://api.github.com/repos/azavea/nyc-trees/statuses/{sha}","languages_url":"https://api.github.com/repos/azavea/nyc-trees/languages","stargazers_url":"https://api.github.com/repos/azavea/nyc-trees/stargazers","contributors_url":"https://api.github.com/repos/azavea/nyc-trees/contributors","subscribers_url":"https://api.github.com/repos/azavea/nyc-trees/subscribers","subscription_url":"https://api.github.com/repos/azavea/nyc-trees/subscription","commits_url":"https://api.github.com/repos/azavea/nyc-trees/commits{/sha}","git_commits_url":"https://api.github.com/repos/azavea/nyc-trees/git/commits{/sha}","comments_url":"https://api.github.com/repos/azavea/nyc-trees/comments{/number}","issue_comment_url":"https://api.github.com/repos/azavea/nyc-trees/issues/comments/{number}","contents_url":"https://api.github.com/repos/azavea/nyc-trees/contents/{+path}","compare_url":"https://api.github.com/repos/azavea/nyc-trees/compare/{base}...{head}","merges_url":"https://api.github.com/repos/azavea/nyc-trees/merges","archive_url":"https://api.github.com/repos/azavea/nyc-trees/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/azavea/nyc-trees/downloads","issues_url":"https://api.github.com/repos/azavea/nyc-trees/issues{/number}","pulls_url":"https://api.github.com/repos/azavea/nyc-trees/pulls{/number}","milestones_url":"https://api.github.com/repos/azavea/nyc-trees/milestones{/number}","notifications_url":"https://api.github.com/repos/azavea/nyc-trees/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/azavea/nyc-trees/labels{/name}","releases_url":"https://api.github.com/repos/azavea/nyc-trees/releases{/id}","created_at":"2014-10-09T16:33:00Z","updated_at":"2014-12-23T18:38:39Z","pushed_at":"2014-12-23T19:37:58Z","git_url":"git://github.com/azavea/nyc-trees.git","ssh_url":"git@github.com:azavea/nyc-trees.git","clone_url":"https://github.com/azavea/nyc-trees.git","svn_url":"https://github.com/azavea/nyc-trees","homepage":null,"size":2865,"stargazers_count":1,"watchers_count":1,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":47,"forks":6,"open_issues":47,"watchers":1,"default_branch":"develop"}},"base":{"label":"azavea:develop","ref":"develop","sha":"e7e78663a0c81608011f018755d1a4b3b0f0e019","user":{"login":"azavea","id":595231,"avatar_url":"https://avatars.githubusercontent.com/u/595231?v=3","gravatar_id":"","url":"https://api.github.com/users/azavea","html_url":"https://github.com/azavea","followers_url":"https://api.github.com/users/azavea/followers","following_url":"https://api.github.com/users/azavea/following{/other_user}","gists_url":"https://api.github.com/users/azavea/gists{/gist_id}","starred_url":"https://api.github.com/users/azavea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azavea/subscriptions","organizations_url":"https://api.github.com/users/azavea/orgs","repos_url":"https://api.github.com/users/azavea/repos","events_url":"https://api.github.com/users/azavea/events{/privacy}","received_events_url":"https://api.github.com/users/azavea/received_events","type":"Organization","site_admin":false},"repo":{"id":24998407,"name":"nyc-trees","full_name":"azavea/nyc-trees","owner":{"login":"azavea","id":595231,"avatar_url":"https://avatars.githubusercontent.com/u/595231?v=3","gravatar_id":"","url":"https://api.github.com/users/azavea","html_url":"https://github.com/azavea","followers_url":"https://api.github.com/users/azavea/followers","following_url":"https://api.github.com/users/azavea/following{/other_user}","gists_url":"https://api.github.com/users/azavea/gists{/gist_id}","starred_url":"https://api.github.com/users/azavea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azavea/subscriptions","organizations_url":"https://api.github.com/users/azavea/orgs","repos_url":"https://api.github.com/users/azavea/repos","events_url":"https://api.github.com/users/azavea/events{/privacy}","received_events_url":"https://api.github.com/users/azavea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/azavea/nyc-trees","description":"NYC Parks Trees Count! 2015 tree census","fork":false,"url":"https://api.github.com/repos/azavea/nyc-trees","forks_url":"https://api.github.com/repos/azavea/nyc-trees/forks","keys_url":"https://api.github.com/repos/azavea/nyc-trees/keys{/key_id}","collaborators_url":"https://api.github.com/repos/azavea/nyc-trees/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/azavea/nyc-trees/teams","hooks_url":"https://api.github.com/repos/azavea/nyc-trees/hooks","issue_events_url":"https://api.github.com/repos/azavea/nyc-trees/issues/events{/number}","events_url":"https://api.github.com/repos/azavea/nyc-trees/events","assignees_url":"https://api.github.com/repos/azavea/nyc-trees/assignees{/user}","branches_url":"https://api.github.com/repos/azavea/nyc-trees/branches{/branch}","tags_url":"https://api.github.com/repos/azavea/nyc-trees/tags","blobs_url":"https://api.github.com/repos/azavea/nyc-trees/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/azavea/nyc-trees/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/azavea/nyc-trees/git/refs{/sha}","trees_url":"https://api.github.com/repos/azavea/nyc-trees/git/trees{/sha}","statuses_url":"https://api.github.com/repos/azavea/nyc-trees/statuses/{sha}","languages_url":"https://api.github.com/repos/azavea/nyc-trees/languages","stargazers_url":"https://api.github.com/repos/azavea/nyc-trees/stargazers","contributors_url":"https://api.github.com/repos/azavea/nyc-trees/contributors","subscribers_url":"https://api.github.com/repos/azavea/nyc-trees/subscribers","subscription_url":"https://api.github.com/repos/azavea/nyc-trees/subscription","commits_url":"https://api.github.com/repos/azavea/nyc-trees/commits{/sha}","git_commits_url":"https://api.github.com/repos/azavea/nyc-trees/git/commits{/sha}","comments_url":"https://api.github.com/repos/azavea/nyc-trees/comments{/number}","issue_comment_url":"https://api.github.com/repos/azavea/nyc-trees/issues/comments/{number}","contents_url":"https://api.github.com/repos/azavea/nyc-trees/contents/{+path}","compare_url":"https://api.github.com/repos/azavea/nyc-trees/compare/{base}...{head}","merges_url":"https://api.github.com/repos/azavea/nyc-trees/merges","archive_url":"https://api.github.com/repos/azavea/nyc-trees/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/azavea/nyc-trees/downloads","issues_url":"https://api.github.com/repos/azavea/nyc-trees/issues{/number}","pulls_url":"https://api.github.com/repos/azavea/nyc-trees/pulls{/number}","milestones_url":"https://api.github.com/repos/azavea/nyc-trees/milestones{/number}","notifications_url":"https://api.github.com/repos/azavea/nyc-trees/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/azavea/nyc-trees/labels{/name}","releases_url":"https://api.github.com/repos/azavea/nyc-trees/releases{/id}","created_at":"2014-10-09T16:33:00Z","updated_at":"2014-12-23T18:38:39Z","pushed_at":"2014-12-23T19:37:58Z","git_url":"git://github.com/azavea/nyc-trees.git","ssh_url":"git@github.com:azavea/nyc-trees.git","clone_url":"https://github.com/azavea/nyc-trees.git","svn_url":"https://github.com/azavea/nyc-trees","homepage":null,"size":2865,"stargazers_count":1,"watchers_count":1,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":47,"forks":6,"open_issues":47,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/azavea/nyc-trees/pulls/186"},"html":{"href":"https://github.com/azavea/nyc-trees/pull/186"},"issue":{"href":"https://api.github.com/repos/azavea/nyc-trees/issues/186"},"comments":{"href":"https://api.github.com/repos/azavea/nyc-trees/issues/186/comments"},"review_comments":{"href":"https://api.github.com/repos/azavea/nyc-trees/pulls/186/comments"},"review_comment":{"href":"https://api.github.com/repos/azavea/nyc-trees/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/azavea/nyc-trees/pulls/186/commits"},"statuses":{"href":"https://api.github.com/repos/azavea/nyc-trees/statuses/a251432d3c0c55c2094051f8e86bfe004d14bab4"}}}}