{"action":"created","comment":{"url":"https://api.github.com/repos/Chorus/chorus/pulls/comments/49676572","id":49676572,"diff_hunk":"@@ -41,7 +41,7 @@ def update\n     end\n \n     def destroy\n-      Authorization::Authority.authorize! :destroy, @data_source, current_user, {:or => :current_user_is_object_owner}\n+      authorize! :destroy, @data_source, current_user, {:or => :current_user_is_object_owner}\n       @data_source.destroy\n       head :ok\n     end","path":"components/api/app/controllers/api/data_sources_controller.rb","position":26,"original_position":26,"commit_id":"9ba46e2402ed471ff0e1bbe732f8c3cd6d83b29b","original_commit_id":"824afc143fa7ee1d4c56ed75537bd9d8ca47a034","user":{"login":"kevinmtrowbridge","id":486640,"avatar_url":"https://avatars.githubusercontent.com/u/486640?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinmtrowbridge","html_url":"https://github.com/kevinmtrowbridge","followers_url":"https://api.github.com/users/kevinmtrowbridge/followers","following_url":"https://api.github.com/users/kevinmtrowbridge/following{/other_user}","gists_url":"https://api.github.com/users/kevinmtrowbridge/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinmtrowbridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinmtrowbridge/subscriptions","organizations_url":"https://api.github.com/users/kevinmtrowbridge/orgs","repos_url":"https://api.github.com/users/kevinmtrowbridge/repos","events_url":"https://api.github.com/users/kevinmtrowbridge/events{/privacy}","received_events_url":"https://api.github.com/users/kevinmtrowbridge/received_events","type":"User","site_admin":false},"body":"Yes it is, because only certain types of users can do it.  This fine-grained level of authorization control is exactly what this new format (of using decorators) allows.  We should liberally move everything out of API that has to do with Authorization.\r\n\r\nOne thing we have to keep track of though, is that, if we want to maintain the backwards compatibility with the old Authorization component, we have to move this stuff in there too.  Just create the same controller_decorator in there, but with only these methods.","created_at":"2016-01-14T01:16:15Z","updated_at":"2016-01-14T01:16:15Z","html_url":"https://github.com/Chorus/chorus/pull/229#discussion_r49676572","pull_request_url":"https://api.github.com/repos/Chorus/chorus/pulls/229","_links":{"self":{"href":"https://api.github.com/repos/Chorus/chorus/pulls/comments/49676572"},"html":{"href":"https://github.com/Chorus/chorus/pull/229#discussion_r49676572"},"pull_request":{"href":"https://api.github.com/repos/Chorus/chorus/pulls/229"}}},"pull_request":{"url":"https://api.github.com/repos/Chorus/chorus/pulls/229","id":55526105,"html_url":"https://github.com/Chorus/chorus/pull/229","diff_url":"https://github.com/Chorus/chorus/pull/229.diff","patch_url":"https://github.com/Chorus/chorus/pull/229.patch","issue_url":"https://api.github.com/repos/Chorus/chorus/issues/229","number":229,"state":"open","locked":false,"title":"Migrates the DataSourcesController to the new auth format","user":{"login":"AndrewLngdn","id":1474568,"avatar_url":"https://avatars.githubusercontent.com/u/1474568?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewLngdn","html_url":"https://github.com/AndrewLngdn","followers_url":"https://api.github.com/users/AndrewLngdn/followers","following_url":"https://api.github.com/users/AndrewLngdn/following{/other_user}","gists_url":"https://api.github.com/users/AndrewLngdn/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewLngdn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewLngdn/subscriptions","organizations_url":"https://api.github.com/users/AndrewLngdn/orgs","repos_url":"https://api.github.com/users/AndrewLngdn/repos","events_url":"https://api.github.com/users/AndrewLngdn/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewLngdn/received_events","type":"User","site_admin":false},"body":"With tests! ","created_at":"2016-01-08T23:57:53Z","updated_at":"2016-01-14T01:16:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e4eb796fa462e337e62369598d6d379fd635febb","assignee":{"login":"kevinmtrowbridge","id":486640,"avatar_url":"https://avatars.githubusercontent.com/u/486640?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinmtrowbridge","html_url":"https://github.com/kevinmtrowbridge","followers_url":"https://api.github.com/users/kevinmtrowbridge/followers","following_url":"https://api.github.com/users/kevinmtrowbridge/following{/other_user}","gists_url":"https://api.github.com/users/kevinmtrowbridge/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinmtrowbridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinmtrowbridge/subscriptions","organizations_url":"https://api.github.com/users/kevinmtrowbridge/orgs","repos_url":"https://api.github.com/users/kevinmtrowbridge/repos","events_url":"https://api.github.com/users/kevinmtrowbridge/events{/privacy}","received_events_url":"https://api.github.com/users/kevinmtrowbridge/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Chorus/chorus/pulls/229/commits","review_comments_url":"https://api.github.com/repos/Chorus/chorus/pulls/229/comments","review_comment_url":"https://api.github.com/repos/Chorus/chorus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Chorus/chorus/issues/229/comments","statuses_url":"https://api.github.com/repos/Chorus/chorus/statuses/9ba46e2402ed471ff0e1bbe732f8c3cd6d83b29b","head":{"label":"Chorus:authorization_simpler-data-source-controller","ref":"authorization_simpler-data-source-controller","sha":"9ba46e2402ed471ff0e1bbe732f8c3cd6d83b29b","user":{"login":"Chorus","id":5614676,"avatar_url":"https://avatars.githubusercontent.com/u/5614676?v=3","gravatar_id":"","url":"https://api.github.com/users/Chorus","html_url":"https://github.com/Chorus","followers_url":"https://api.github.com/users/Chorus/followers","following_url":"https://api.github.com/users/Chorus/following{/other_user}","gists_url":"https://api.github.com/users/Chorus/gists{/gist_id}","starred_url":"https://api.github.com/users/Chorus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chorus/subscriptions","organizations_url":"https://api.github.com/users/Chorus/orgs","repos_url":"https://api.github.com/users/Chorus/repos","events_url":"https://api.github.com/users/Chorus/events{/privacy}","received_events_url":"https://api.github.com/users/Chorus/received_events","type":"Organization","site_admin":false},"repo":{"id":2751440,"name":"chorus","full_name":"Chorus/chorus","owner":{"login":"Chorus","id":5614676,"avatar_url":"https://avatars.githubusercontent.com/u/5614676?v=3","gravatar_id":"","url":"https://api.github.com/users/Chorus","html_url":"https://github.com/Chorus","followers_url":"https://api.github.com/users/Chorus/followers","following_url":"https://api.github.com/users/Chorus/following{/other_user}","gists_url":"https://api.github.com/users/Chorus/gists{/gist_id}","starred_url":"https://api.github.com/users/Chorus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chorus/subscriptions","organizations_url":"https://api.github.com/users/Chorus/orgs","repos_url":"https://api.github.com/users/Chorus/repos","events_url":"https://api.github.com/users/Chorus/events{/privacy}","received_events_url":"https://api.github.com/users/Chorus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Chorus/chorus","description":"Chorus allows customers, partners, developers, and data scientists to collaboratively realize the potential of Big Data.","fork":false,"url":"https://api.github.com/repos/Chorus/chorus","forks_url":"https://api.github.com/repos/Chorus/chorus/forks","keys_url":"https://api.github.com/repos/Chorus/chorus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Chorus/chorus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Chorus/chorus/teams","hooks_url":"https://api.github.com/repos/Chorus/chorus/hooks","issue_events_url":"https://api.github.com/repos/Chorus/chorus/issues/events{/number}","events_url":"https://api.github.com/repos/Chorus/chorus/events","assignees_url":"https://api.github.com/repos/Chorus/chorus/assignees{/user}","branches_url":"https://api.github.com/repos/Chorus/chorus/branches{/branch}","tags_url":"https://api.github.com/repos/Chorus/chorus/tags","blobs_url":"https://api.github.com/repos/Chorus/chorus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Chorus/chorus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Chorus/chorus/git/refs{/sha}","trees_url":"https://api.github.com/repos/Chorus/chorus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Chorus/chorus/statuses/{sha}","languages_url":"https://api.github.com/repos/Chorus/chorus/languages","stargazers_url":"https://api.github.com/repos/Chorus/chorus/stargazers","contributors_url":"https://api.github.com/repos/Chorus/chorus/contributors","subscribers_url":"https://api.github.com/repos/Chorus/chorus/subscribers","subscription_url":"https://api.github.com/repos/Chorus/chorus/subscription","commits_url":"https://api.github.com/repos/Chorus/chorus/commits{/sha}","git_commits_url":"https://api.github.com/repos/Chorus/chorus/git/commits{/sha}","comments_url":"https://api.github.com/repos/Chorus/chorus/comments{/number}","issue_comment_url":"https://api.github.com/repos/Chorus/chorus/issues/comments{/number}","contents_url":"https://api.github.com/repos/Chorus/chorus/contents/{+path}","compare_url":"https://api.github.com/repos/Chorus/chorus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Chorus/chorus/merges","archive_url":"https://api.github.com/repos/Chorus/chorus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Chorus/chorus/downloads","issues_url":"https://api.github.com/repos/Chorus/chorus/issues{/number}","pulls_url":"https://api.github.com/repos/Chorus/chorus/pulls{/number}","milestones_url":"https://api.github.com/repos/Chorus/chorus/milestones{/number}","notifications_url":"https://api.github.com/repos/Chorus/chorus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Chorus/chorus/labels{/name}","releases_url":"https://api.github.com/repos/Chorus/chorus/releases{/id}","created_at":"2011-11-10T20:30:13Z","updated_at":"2015-12-26T02:31:44Z","pushed_at":"2016-01-14T00:51:19Z","git_url":"git://github.com/Chorus/chorus.git","ssh_url":"git@github.com:Chorus/chorus.git","clone_url":"https://github.com/Chorus/chorus.git","svn_url":"https://github.com/Chorus/chorus","homepage":"","size":834179,"stargazers_count":176,"watchers_count":176,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":73,"mirror_url":null,"open_issues_count":14,"forks":73,"open_issues":14,"watchers":176,"default_branch":"master"}},"base":{"label":"Chorus:authorization_simpler","ref":"authorization_simpler","sha":"32aee01309947d04c1c3f8728e815742cd8f3d3c","user":{"login":"Chorus","id":5614676,"avatar_url":"https://avatars.githubusercontent.com/u/5614676?v=3","gravatar_id":"","url":"https://api.github.com/users/Chorus","html_url":"https://github.com/Chorus","followers_url":"https://api.github.com/users/Chorus/followers","following_url":"https://api.github.com/users/Chorus/following{/other_user}","gists_url":"https://api.github.com/users/Chorus/gists{/gist_id}","starred_url":"https://api.github.com/users/Chorus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chorus/subscriptions","organizations_url":"https://api.github.com/users/Chorus/orgs","repos_url":"https://api.github.com/users/Chorus/repos","events_url":"https://api.github.com/users/Chorus/events{/privacy}","received_events_url":"https://api.github.com/users/Chorus/received_events","type":"Organization","site_admin":false},"repo":{"id":2751440,"name":"chorus","full_name":"Chorus/chorus","owner":{"login":"Chorus","id":5614676,"avatar_url":"https://avatars.githubusercontent.com/u/5614676?v=3","gravatar_id":"","url":"https://api.github.com/users/Chorus","html_url":"https://github.com/Chorus","followers_url":"https://api.github.com/users/Chorus/followers","following_url":"https://api.github.com/users/Chorus/following{/other_user}","gists_url":"https://api.github.com/users/Chorus/gists{/gist_id}","starred_url":"https://api.github.com/users/Chorus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chorus/subscriptions","organizations_url":"https://api.github.com/users/Chorus/orgs","repos_url":"https://api.github.com/users/Chorus/repos","events_url":"https://api.github.com/users/Chorus/events{/privacy}","received_events_url":"https://api.github.com/users/Chorus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Chorus/chorus","description":"Chorus allows customers, partners, developers, and data scientists to collaboratively realize the potential of Big Data.","fork":false,"url":"https://api.github.com/repos/Chorus/chorus","forks_url":"https://api.github.com/repos/Chorus/chorus/forks","keys_url":"https://api.github.com/repos/Chorus/chorus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Chorus/chorus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Chorus/chorus/teams","hooks_url":"https://api.github.com/repos/Chorus/chorus/hooks","issue_events_url":"https://api.github.com/repos/Chorus/chorus/issues/events{/number}","events_url":"https://api.github.com/repos/Chorus/chorus/events","assignees_url":"https://api.github.com/repos/Chorus/chorus/assignees{/user}","branches_url":"https://api.github.com/repos/Chorus/chorus/branches{/branch}","tags_url":"https://api.github.com/repos/Chorus/chorus/tags","blobs_url":"https://api.github.com/repos/Chorus/chorus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Chorus/chorus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Chorus/chorus/git/refs{/sha}","trees_url":"https://api.github.com/repos/Chorus/chorus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Chorus/chorus/statuses/{sha}","languages_url":"https://api.github.com/repos/Chorus/chorus/languages","stargazers_url":"https://api.github.com/repos/Chorus/chorus/stargazers","contributors_url":"https://api.github.com/repos/Chorus/chorus/contributors","subscribers_url":"https://api.github.com/repos/Chorus/chorus/subscribers","subscription_url":"https://api.github.com/repos/Chorus/chorus/subscription","commits_url":"https://api.github.com/repos/Chorus/chorus/commits{/sha}","git_commits_url":"https://api.github.com/repos/Chorus/chorus/git/commits{/sha}","comments_url":"https://api.github.com/repos/Chorus/chorus/comments{/number}","issue_comment_url":"https://api.github.com/repos/Chorus/chorus/issues/comments{/number}","contents_url":"https://api.github.com/repos/Chorus/chorus/contents/{+path}","compare_url":"https://api.github.com/repos/Chorus/chorus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Chorus/chorus/merges","archive_url":"https://api.github.com/repos/Chorus/chorus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Chorus/chorus/downloads","issues_url":"https://api.github.com/repos/Chorus/chorus/issues{/number}","pulls_url":"https://api.github.com/repos/Chorus/chorus/pulls{/number}","milestones_url":"https://api.github.com/repos/Chorus/chorus/milestones{/number}","notifications_url":"https://api.github.com/repos/Chorus/chorus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Chorus/chorus/labels{/name}","releases_url":"https://api.github.com/repos/Chorus/chorus/releases{/id}","created_at":"2011-11-10T20:30:13Z","updated_at":"2015-12-26T02:31:44Z","pushed_at":"2016-01-14T00:51:19Z","git_url":"git://github.com/Chorus/chorus.git","ssh_url":"git@github.com:Chorus/chorus.git","clone_url":"https://github.com/Chorus/chorus.git","svn_url":"https://github.com/Chorus/chorus","homepage":"","size":834179,"stargazers_count":176,"watchers_count":176,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":73,"mirror_url":null,"open_issues_count":14,"forks":73,"open_issues":14,"watchers":176,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Chorus/chorus/pulls/229"},"html":{"href":"https://github.com/Chorus/chorus/pull/229"},"issue":{"href":"https://api.github.com/repos/Chorus/chorus/issues/229"},"comments":{"href":"https://api.github.com/repos/Chorus/chorus/issues/229/comments"},"review_comments":{"href":"https://api.github.com/repos/Chorus/chorus/pulls/229/comments"},"review_comment":{"href":"https://api.github.com/repos/Chorus/chorus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Chorus/chorus/pulls/229/commits"},"statuses":{"href":"https://api.github.com/repos/Chorus/chorus/statuses/9ba46e2402ed471ff0e1bbe732f8c3cd6d83b29b"}}}}