{"action":"created","comment":{"url":"https://api.github.com/repos/soulim/rbjobs/pulls/comments/35062742","id":35062742,"diff_hunk":"@@ -0,0 +1,17 @@\n+module Authentication\n+  extend ActiveSupport::Concern\n+\n+  def authorize!(action, vacancy)\n+    case action\n+    when :read\n+      return vacancy.approved? || admin?(vacancy)\n+    when :edit, :update\n+      return (vacancy.approved? && owner?(vacancy)) || admin?(vacancy)\n+    when :destroy, :approve\n+      return admin?(vacancy)\n+    else\n+      raise StandartError","path":"app/models/concerns/authentication.rb","position":13,"original_position":13,"commit_id":"195ec2262c2b58cb45d45a6866c0790abd83b83e","original_commit_id":"195ec2262c2b58cb45d45a6866c0790abd83b83e","user":{"login":"rafaelsales","id":1196663,"avatar_url":"https://avatars.githubusercontent.com/u/1196663?v=3","gravatar_id":"","url":"https://api.github.com/users/rafaelsales","html_url":"https://github.com/rafaelsales","followers_url":"https://api.github.com/users/rafaelsales/followers","following_url":"https://api.github.com/users/rafaelsales/following{/other_user}","gists_url":"https://api.github.com/users/rafaelsales/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaelsales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaelsales/subscriptions","organizations_url":"https://api.github.com/users/rafaelsales/orgs","repos_url":"https://api.github.com/users/rafaelsales/repos","events_url":"https://api.github.com/users/rafaelsales/events{/privacy}","received_events_url":"https://api.github.com/users/rafaelsales/received_events","type":"User","site_admin":false},"body":"Can you fix the typo and provide more info here?\r\n`raise StandardError, \"Unknown action #{action.inspect}\"","created_at":"2015-07-21T01:28:42Z","updated_at":"2015-07-21T01:28:42Z","html_url":"https://github.com/soulim/rbjobs/pull/19#discussion_r35062742","pull_request_url":"https://api.github.com/repos/soulim/rbjobs/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/soulim/rbjobs/pulls/comments/35062742"},"html":{"href":"https://github.com/soulim/rbjobs/pull/19#discussion_r35062742"},"pull_request":{"href":"https://api.github.com/repos/soulim/rbjobs/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/soulim/rbjobs/pulls/19","id":40413456,"html_url":"https://github.com/soulim/rbjobs/pull/19","diff_url":"https://github.com/soulim/rbjobs/pull/19.diff","patch_url":"https://github.com/soulim/rbjobs/pull/19.patch","issue_url":"https://api.github.com/repos/soulim/rbjobs/issues/19","number":19,"state":"open","locked":false,"title":"Create module for authentication + removing trailing whitespaces","user":{"login":"franzejr","id":868917,"avatar_url":"https://avatars.githubusercontent.com/u/868917?v=3","gravatar_id":"","url":"https://api.github.com/users/franzejr","html_url":"https://github.com/franzejr","followers_url":"https://api.github.com/users/franzejr/followers","following_url":"https://api.github.com/users/franzejr/following{/other_user}","gists_url":"https://api.github.com/users/franzejr/gists{/gist_id}","starred_url":"https://api.github.com/users/franzejr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/franzejr/subscriptions","organizations_url":"https://api.github.com/users/franzejr/orgs","repos_url":"https://api.github.com/users/franzejr/repos","events_url":"https://api.github.com/users/franzejr/events{/privacy}","received_events_url":"https://api.github.com/users/franzejr/received_events","type":"User","site_admin":false},"body":"Hello,\r\n\r\nI saw it was a TODO in your controller to remove the code related to Authentication from your controller. I changed that to a module. I also removed trailing whitespace from the project.\r\nIt's a simple PR.\r\n\r\nHope it could help your project.","created_at":"2015-07-21T01:01:13Z","updated_at":"2015-07-21T01:28:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d471431e733e4e77fe319484c0d0cf9bbaaf77f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/soulim/rbjobs/pulls/19/commits","review_comments_url":"https://api.github.com/repos/soulim/rbjobs/pulls/19/comments","review_comment_url":"https://api.github.com/repos/soulim/rbjobs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/soulim/rbjobs/issues/19/comments","statuses_url":"https://api.github.com/repos/soulim/rbjobs/statuses/195ec2262c2b58cb45d45a6866c0790abd83b83e","head":{"label":"franzejr:master","ref":"master","sha":"195ec2262c2b58cb45d45a6866c0790abd83b83e","user":{"login":"franzejr","id":868917,"avatar_url":"https://avatars.githubusercontent.com/u/868917?v=3","gravatar_id":"","url":"https://api.github.com/users/franzejr","html_url":"https://github.com/franzejr","followers_url":"https://api.github.com/users/franzejr/followers","following_url":"https://api.github.com/users/franzejr/following{/other_user}","gists_url":"https://api.github.com/users/franzejr/gists{/gist_id}","starred_url":"https://api.github.com/users/franzejr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/franzejr/subscriptions","organizations_url":"https://api.github.com/users/franzejr/orgs","repos_url":"https://api.github.com/users/franzejr/repos","events_url":"https://api.github.com/users/franzejr/events{/privacy}","received_events_url":"https://api.github.com/users/franzejr/received_events","type":"User","site_admin":false},"repo":{"id":39415201,"name":"rbjobs","full_name":"franzejr/rbjobs","owner":{"login":"franzejr","id":868917,"avatar_url":"https://avatars.githubusercontent.com/u/868917?v=3","gravatar_id":"","url":"https://api.github.com/users/franzejr","html_url":"https://github.com/franzejr","followers_url":"https://api.github.com/users/franzejr/followers","following_url":"https://api.github.com/users/franzejr/following{/other_user}","gists_url":"https://api.github.com/users/franzejr/gists{/gist_id}","starred_url":"https://api.github.com/users/franzejr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/franzejr/subscriptions","organizations_url":"https://api.github.com/users/franzejr/orgs","repos_url":"https://api.github.com/users/franzejr/repos","events_url":"https://api.github.com/users/franzejr/events{/privacy}","received_events_url":"https://api.github.com/users/franzejr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/franzejr/rbjobs","description":"The first and one of the most popular Ruby focused Russian job boards","fork":true,"url":"https://api.github.com/repos/franzejr/rbjobs","forks_url":"https://api.github.com/repos/franzejr/rbjobs/forks","keys_url":"https://api.github.com/repos/franzejr/rbjobs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/franzejr/rbjobs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/franzejr/rbjobs/teams","hooks_url":"https://api.github.com/repos/franzejr/rbjobs/hooks","issue_events_url":"https://api.github.com/repos/franzejr/rbjobs/issues/events{/number}","events_url":"https://api.github.com/repos/franzejr/rbjobs/events","assignees_url":"https://api.github.com/repos/franzejr/rbjobs/assignees{/user}","branches_url":"https://api.github.com/repos/franzejr/rbjobs/branches{/branch}","tags_url":"https://api.github.com/repos/franzejr/rbjobs/tags","blobs_url":"https://api.github.com/repos/franzejr/rbjobs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/franzejr/rbjobs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/franzejr/rbjobs/git/refs{/sha}","trees_url":"https://api.github.com/repos/franzejr/rbjobs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/franzejr/rbjobs/statuses/{sha}","languages_url":"https://api.github.com/repos/franzejr/rbjobs/languages","stargazers_url":"https://api.github.com/repos/franzejr/rbjobs/stargazers","contributors_url":"https://api.github.com/repos/franzejr/rbjobs/contributors","subscribers_url":"https://api.github.com/repos/franzejr/rbjobs/subscribers","subscription_url":"https://api.github.com/repos/franzejr/rbjobs/subscription","commits_url":"https://api.github.com/repos/franzejr/rbjobs/commits{/sha}","git_commits_url":"https://api.github.com/repos/franzejr/rbjobs/git/commits{/sha}","comments_url":"https://api.github.com/repos/franzejr/rbjobs/comments{/number}","issue_comment_url":"https://api.github.com/repos/franzejr/rbjobs/issues/comments{/number}","contents_url":"https://api.github.com/repos/franzejr/rbjobs/contents/{+path}","compare_url":"https://api.github.com/repos/franzejr/rbjobs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/franzejr/rbjobs/merges","archive_url":"https://api.github.com/repos/franzejr/rbjobs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/franzejr/rbjobs/downloads","issues_url":"https://api.github.com/repos/franzejr/rbjobs/issues{/number}","pulls_url":"https://api.github.com/repos/franzejr/rbjobs/pulls{/number}","milestones_url":"https://api.github.com/repos/franzejr/rbjobs/milestones{/number}","notifications_url":"https://api.github.com/repos/franzejr/rbjobs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/franzejr/rbjobs/labels{/name}","releases_url":"https://api.github.com/repos/franzejr/rbjobs/releases{/id}","created_at":"2015-07-21T00:31:16Z","updated_at":"2015-07-21T00:31:16Z","pushed_at":"2015-07-21T00:50:54Z","git_url":"git://github.com/franzejr/rbjobs.git","ssh_url":"git@github.com:franzejr/rbjobs.git","clone_url":"https://github.com/franzejr/rbjobs.git","svn_url":"https://github.com/franzejr/rbjobs","homepage":"http://rubyjobs.ru","size":510,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"soulim:master","ref":"master","sha":"abbb8dacb20a72edf5f45bd4fcf317da04c615c7","user":{"login":"soulim","id":2370,"avatar_url":"https://avatars.githubusercontent.com/u/2370?v=3","gravatar_id":"","url":"https://api.github.com/users/soulim","html_url":"https://github.com/soulim","followers_url":"https://api.github.com/users/soulim/followers","following_url":"https://api.github.com/users/soulim/following{/other_user}","gists_url":"https://api.github.com/users/soulim/gists{/gist_id}","starred_url":"https://api.github.com/users/soulim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soulim/subscriptions","organizations_url":"https://api.github.com/users/soulim/orgs","repos_url":"https://api.github.com/users/soulim/repos","events_url":"https://api.github.com/users/soulim/events{/privacy}","received_events_url":"https://api.github.com/users/soulim/received_events","type":"User","site_admin":false},"repo":{"id":2614402,"name":"rbjobs","full_name":"soulim/rbjobs","owner":{"login":"soulim","id":2370,"avatar_url":"https://avatars.githubusercontent.com/u/2370?v=3","gravatar_id":"","url":"https://api.github.com/users/soulim","html_url":"https://github.com/soulim","followers_url":"https://api.github.com/users/soulim/followers","following_url":"https://api.github.com/users/soulim/following{/other_user}","gists_url":"https://api.github.com/users/soulim/gists{/gist_id}","starred_url":"https://api.github.com/users/soulim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soulim/subscriptions","organizations_url":"https://api.github.com/users/soulim/orgs","repos_url":"https://api.github.com/users/soulim/repos","events_url":"https://api.github.com/users/soulim/events{/privacy}","received_events_url":"https://api.github.com/users/soulim/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/soulim/rbjobs","description":"The first and one of the most popular Ruby focused Russian job boards","fork":false,"url":"https://api.github.com/repos/soulim/rbjobs","forks_url":"https://api.github.com/repos/soulim/rbjobs/forks","keys_url":"https://api.github.com/repos/soulim/rbjobs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/soulim/rbjobs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/soulim/rbjobs/teams","hooks_url":"https://api.github.com/repos/soulim/rbjobs/hooks","issue_events_url":"https://api.github.com/repos/soulim/rbjobs/issues/events{/number}","events_url":"https://api.github.com/repos/soulim/rbjobs/events","assignees_url":"https://api.github.com/repos/soulim/rbjobs/assignees{/user}","branches_url":"https://api.github.com/repos/soulim/rbjobs/branches{/branch}","tags_url":"https://api.github.com/repos/soulim/rbjobs/tags","blobs_url":"https://api.github.com/repos/soulim/rbjobs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/soulim/rbjobs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/soulim/rbjobs/git/refs{/sha}","trees_url":"https://api.github.com/repos/soulim/rbjobs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/soulim/rbjobs/statuses/{sha}","languages_url":"https://api.github.com/repos/soulim/rbjobs/languages","stargazers_url":"https://api.github.com/repos/soulim/rbjobs/stargazers","contributors_url":"https://api.github.com/repos/soulim/rbjobs/contributors","subscribers_url":"https://api.github.com/repos/soulim/rbjobs/subscribers","subscription_url":"https://api.github.com/repos/soulim/rbjobs/subscription","commits_url":"https://api.github.com/repos/soulim/rbjobs/commits{/sha}","git_commits_url":"https://api.github.com/repos/soulim/rbjobs/git/commits{/sha}","comments_url":"https://api.github.com/repos/soulim/rbjobs/comments{/number}","issue_comment_url":"https://api.github.com/repos/soulim/rbjobs/issues/comments{/number}","contents_url":"https://api.github.com/repos/soulim/rbjobs/contents/{+path}","compare_url":"https://api.github.com/repos/soulim/rbjobs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/soulim/rbjobs/merges","archive_url":"https://api.github.com/repos/soulim/rbjobs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/soulim/rbjobs/downloads","issues_url":"https://api.github.com/repos/soulim/rbjobs/issues{/number}","pulls_url":"https://api.github.com/repos/soulim/rbjobs/pulls{/number}","milestones_url":"https://api.github.com/repos/soulim/rbjobs/milestones{/number}","notifications_url":"https://api.github.com/repos/soulim/rbjobs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/soulim/rbjobs/labels{/name}","releases_url":"https://api.github.com/repos/soulim/rbjobs/releases{/id}","created_at":"2011-10-20T16:25:52Z","updated_at":"2015-05-21T07:32:17Z","pushed_at":"2015-07-21T01:01:14Z","git_url":"git://github.com/soulim/rbjobs.git","ssh_url":"git@github.com:soulim/rbjobs.git","clone_url":"https://github.com/soulim/rbjobs.git","svn_url":"https://github.com/soulim/rbjobs","homepage":"http://rubyjobs.ru","size":696,"stargazers_count":20,"watchers_count":20,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":2,"forks":14,"open_issues":2,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/soulim/rbjobs/pulls/19"},"html":{"href":"https://github.com/soulim/rbjobs/pull/19"},"issue":{"href":"https://api.github.com/repos/soulim/rbjobs/issues/19"},"comments":{"href":"https://api.github.com/repos/soulim/rbjobs/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/soulim/rbjobs/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/soulim/rbjobs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/soulim/rbjobs/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/soulim/rbjobs/statuses/195ec2262c2b58cb45d45a6866c0790abd83b83e"}}}}