{"action":"created","comment":{"url":"https://api.github.com/repos/emilyzhong/derailed/pulls/comments/183780112","pull_request_review_id":114843356,"id":183780112,"diff_hunk":"@@ -1,3 +1,47 @@\n class ApplicationController < ActionController::Base\n   protect_from_forgery with: :exception\n+\n+  def authenticate!\n+    @current_user = get_current_user\n+    if @current_user.nil?\n+      puts \"User is nil\"\n+      redirect_to \"/sign_in\"\n+    elsif @current_user.is_a? Admin\n+      :authenticate_admin!\n+      puts \"User is admin\"\n+    elsif @current_user.is_a? Student\n+      :authenticate_student!\n+      puts \"User is student\"\n+    else\n+      puts \"What the hell is user??\"","path":"app/controllers/application_controller.rb","position":16,"original_position":16,"commit_id":"d745b32e649e21dd2c516fb5f2c7624baa4d6f35","original_commit_id":"d745b32e649e21dd2c516fb5f2c7624baa4d6f35","user":{"login":"emilyzhong","id":23442055,"avatar_url":"https://avatars2.githubusercontent.com/u/23442055?v=4","gravatar_id":"","url":"https://api.github.com/users/emilyzhong","html_url":"https://github.com/emilyzhong","followers_url":"https://api.github.com/users/emilyzhong/followers","following_url":"https://api.github.com/users/emilyzhong/following{/other_user}","gists_url":"https://api.github.com/users/emilyzhong/gists{/gist_id}","starred_url":"https://api.github.com/users/emilyzhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilyzhong/subscriptions","organizations_url":"https://api.github.com/users/emilyzhong/orgs","repos_url":"https://api.github.com/users/emilyzhong/repos","events_url":"https://api.github.com/users/emilyzhong/events{/privacy}","received_events_url":"https://api.github.com/users/emilyzhong/received_events","type":"User","site_admin":false},"body":"same","created_at":"2018-04-24T15:35:52Z","updated_at":"2018-04-24T15:38:40Z","html_url":"https://github.com/emilyzhong/derailed/pull/9#discussion_r183780112","pull_request_url":"https://api.github.com/repos/emilyzhong/derailed/pulls/9","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/emilyzhong/derailed/pulls/comments/183780112"},"html":{"href":"https://github.com/emilyzhong/derailed/pull/9#discussion_r183780112"},"pull_request":{"href":"https://api.github.com/repos/emilyzhong/derailed/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/emilyzhong/derailed/pulls/9","id":183705549,"html_url":"https://github.com/emilyzhong/derailed/pull/9","diff_url":"https://github.com/emilyzhong/derailed/pull/9.diff","patch_url":"https://github.com/emilyzhong/derailed/pull/9.patch","issue_url":"https://api.github.com/repos/emilyzhong/derailed/issues/9","number":9,"state":"open","locked":false,"title":"Aivant/devise","user":{"login":"aivantg","id":5147486,"avatar_url":"https://avatars0.githubusercontent.com/u/5147486?v=4","gravatar_id":"","url":"https://api.github.com/users/aivantg","html_url":"https://github.com/aivantg","followers_url":"https://api.github.com/users/aivantg/followers","following_url":"https://api.github.com/users/aivantg/following{/other_user}","gists_url":"https://api.github.com/users/aivantg/gists{/gist_id}","starred_url":"https://api.github.com/users/aivantg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aivantg/subscriptions","organizations_url":"https://api.github.com/users/aivantg/orgs","repos_url":"https://api.github.com/users/aivantg/repos","events_url":"https://api.github.com/users/aivantg/events{/privacy}","received_events_url":"https://api.github.com/users/aivantg/received_events","type":"User","site_admin":false},"body":"### What does this PR do?\r\n- Adds Devise fields to models\r\n- Provides separate login/signup interface for users and admins (through devise default views)\r\n- Implements Student/Admin/Auditor logic on the semesters page (students can't add resources, auditors can't access any other features)\r\n- Fixes minor bug in seed file now allowing you to simply call `rake db:seed` instead of having to reset\r\n- root now redirects to first semester for convenience\r\n- Provided helper functions in application_controller\r\n\r\n### Status\r\nReady! But un-styled and not battle tested against possible abuse, an\r\n\r\n### Migrations\r\nYES\r\n\r\n### Description of Testing Done\r\nSigned in and out of each state and into another to assure that proper views show up\r\n\r\n### Todos\r\n- [ ] More Thorough Testing\r\n- [ ] Styling\r\n- [ ] Incorporating more detailed admin logic for accessing and creating resources in api-related controllers\r\n\r\nCC: @aivantg @emilyzhong @francotorium\r\n","created_at":"2018-04-24T11:32:48Z","updated_at":"2018-04-24T15:38:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"144a41a07bb5e6b7ca6ffc63bacb4539f134cb95","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/emilyzhong/derailed/pulls/9/commits","review_comments_url":"https://api.github.com/repos/emilyzhong/derailed/pulls/9/comments","review_comment_url":"https://api.github.com/repos/emilyzhong/derailed/pulls/comments{/number}","comments_url":"https://api.github.com/repos/emilyzhong/derailed/issues/9/comments","statuses_url":"https://api.github.com/repos/emilyzhong/derailed/statuses/d745b32e649e21dd2c516fb5f2c7624baa4d6f35","head":{"label":"emilyzhong:aivant/devise","ref":"aivant/devise","sha":"d745b32e649e21dd2c516fb5f2c7624baa4d6f35","user":{"login":"emilyzhong","id":23442055,"avatar_url":"https://avatars2.githubusercontent.com/u/23442055?v=4","gravatar_id":"","url":"https://api.github.com/users/emilyzhong","html_url":"https://github.com/emilyzhong","followers_url":"https://api.github.com/users/emilyzhong/followers","following_url":"https://api.github.com/users/emilyzhong/following{/other_user}","gists_url":"https://api.github.com/users/emilyzhong/gists{/gist_id}","starred_url":"https://api.github.com/users/emilyzhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilyzhong/subscriptions","organizations_url":"https://api.github.com/users/emilyzhong/orgs","repos_url":"https://api.github.com/users/emilyzhong/repos","events_url":"https://api.github.com/users/emilyzhong/events{/privacy}","received_events_url":"https://api.github.com/users/emilyzhong/received_events","type":"User","site_admin":false},"repo":{"id":129343164,"name":"derailed","full_name":"emilyzhong/derailed","owner":{"login":"emilyzhong","id":23442055,"avatar_url":"https://avatars2.githubusercontent.com/u/23442055?v=4","gravatar_id":"","url":"https://api.github.com/users/emilyzhong","html_url":"https://github.com/emilyzhong","followers_url":"https://api.github.com/users/emilyzhong/followers","following_url":"https://api.github.com/users/emilyzhong/following{/other_user}","gists_url":"https://api.github.com/users/emilyzhong/gists{/gist_id}","starred_url":"https://api.github.com/users/emilyzhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilyzhong/subscriptions","organizations_url":"https://api.github.com/users/emilyzhong/orgs","repos_url":"https://api.github.com/users/emilyzhong/repos","events_url":"https://api.github.com/users/emilyzhong/events{/privacy}","received_events_url":"https://api.github.com/users/emilyzhong/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/emilyzhong/derailed","description":"Rails DeCal Project!","fork":false,"url":"https://api.github.com/repos/emilyzhong/derailed","forks_url":"https://api.github.com/repos/emilyzhong/derailed/forks","keys_url":"https://api.github.com/repos/emilyzhong/derailed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emilyzhong/derailed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emilyzhong/derailed/teams","hooks_url":"https://api.github.com/repos/emilyzhong/derailed/hooks","issue_events_url":"https://api.github.com/repos/emilyzhong/derailed/issues/events{/number}","events_url":"https://api.github.com/repos/emilyzhong/derailed/events","assignees_url":"https://api.github.com/repos/emilyzhong/derailed/assignees{/user}","branches_url":"https://api.github.com/repos/emilyzhong/derailed/branches{/branch}","tags_url":"https://api.github.com/repos/emilyzhong/derailed/tags","blobs_url":"https://api.github.com/repos/emilyzhong/derailed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emilyzhong/derailed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emilyzhong/derailed/git/refs{/sha}","trees_url":"https://api.github.com/repos/emilyzhong/derailed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emilyzhong/derailed/statuses/{sha}","languages_url":"https://api.github.com/repos/emilyzhong/derailed/languages","stargazers_url":"https://api.github.com/repos/emilyzhong/derailed/stargazers","contributors_url":"https://api.github.com/repos/emilyzhong/derailed/contributors","subscribers_url":"https://api.github.com/repos/emilyzhong/derailed/subscribers","subscription_url":"https://api.github.com/repos/emilyzhong/derailed/subscription","commits_url":"https://api.github.com/repos/emilyzhong/derailed/commits{/sha}","git_commits_url":"https://api.github.com/repos/emilyzhong/derailed/git/commits{/sha}","comments_url":"https://api.github.com/repos/emilyzhong/derailed/comments{/number}","issue_comment_url":"https://api.github.com/repos/emilyzhong/derailed/issues/comments{/number}","contents_url":"https://api.github.com/repos/emilyzhong/derailed/contents/{+path}","compare_url":"https://api.github.com/repos/emilyzhong/derailed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emilyzhong/derailed/merges","archive_url":"https://api.github.com/repos/emilyzhong/derailed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emilyzhong/derailed/downloads","issues_url":"https://api.github.com/repos/emilyzhong/derailed/issues{/number}","pulls_url":"https://api.github.com/repos/emilyzhong/derailed/pulls{/number}","milestones_url":"https://api.github.com/repos/emilyzhong/derailed/milestones{/number}","notifications_url":"https://api.github.com/repos/emilyzhong/derailed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emilyzhong/derailed/labels{/name}","releases_url":"https://api.github.com/repos/emilyzhong/derailed/releases{/id}","deployments_url":"https://api.github.com/repos/emilyzhong/derailed/deployments","created_at":"2018-04-13T03:34:18Z","updated_at":"2018-04-21T02:12:22Z","pushed_at":"2018-04-24T11:34:52Z","git_url":"git://github.com/emilyzhong/derailed.git","ssh_url":"git@github.com:emilyzhong/derailed.git","clone_url":"https://github.com/emilyzhong/derailed.git","svn_url":"https://github.com/emilyzhong/derailed","homepage":null,"size":560,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"emilyzhong:master","ref":"master","sha":"822fb9537aa5598707249ad8051477f3ed40f47e","user":{"login":"emilyzhong","id":23442055,"avatar_url":"https://avatars2.githubusercontent.com/u/23442055?v=4","gravatar_id":"","url":"https://api.github.com/users/emilyzhong","html_url":"https://github.com/emilyzhong","followers_url":"https://api.github.com/users/emilyzhong/followers","following_url":"https://api.github.com/users/emilyzhong/following{/other_user}","gists_url":"https://api.github.com/users/emilyzhong/gists{/gist_id}","starred_url":"https://api.github.com/users/emilyzhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilyzhong/subscriptions","organizations_url":"https://api.github.com/users/emilyzhong/orgs","repos_url":"https://api.github.com/users/emilyzhong/repos","events_url":"https://api.github.com/users/emilyzhong/events{/privacy}","received_events_url":"https://api.github.com/users/emilyzhong/received_events","type":"User","site_admin":false},"repo":{"id":129343164,"name":"derailed","full_name":"emilyzhong/derailed","owner":{"login":"emilyzhong","id":23442055,"avatar_url":"https://avatars2.githubusercontent.com/u/23442055?v=4","gravatar_id":"","url":"https://api.github.com/users/emilyzhong","html_url":"https://github.com/emilyzhong","followers_url":"https://api.github.com/users/emilyzhong/followers","following_url":"https://api.github.com/users/emilyzhong/following{/other_user}","gists_url":"https://api.github.com/users/emilyzhong/gists{/gist_id}","starred_url":"https://api.github.com/users/emilyzhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilyzhong/subscriptions","organizations_url":"https://api.github.com/users/emilyzhong/orgs","repos_url":"https://api.github.com/users/emilyzhong/repos","events_url":"https://api.github.com/users/emilyzhong/events{/privacy}","received_events_url":"https://api.github.com/users/emilyzhong/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/emilyzhong/derailed","description":"Rails DeCal Project!","fork":false,"url":"https://api.github.com/repos/emilyzhong/derailed","forks_url":"https://api.github.com/repos/emilyzhong/derailed/forks","keys_url":"https://api.github.com/repos/emilyzhong/derailed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emilyzhong/derailed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emilyzhong/derailed/teams","hooks_url":"https://api.github.com/repos/emilyzhong/derailed/hooks","issue_events_url":"https://api.github.com/repos/emilyzhong/derailed/issues/events{/number}","events_url":"https://api.github.com/repos/emilyzhong/derailed/events","assignees_url":"https://api.github.com/repos/emilyzhong/derailed/assignees{/user}","branches_url":"https://api.github.com/repos/emilyzhong/derailed/branches{/branch}","tags_url":"https://api.github.com/repos/emilyzhong/derailed/tags","blobs_url":"https://api.github.com/repos/emilyzhong/derailed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emilyzhong/derailed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emilyzhong/derailed/git/refs{/sha}","trees_url":"https://api.github.com/repos/emilyzhong/derailed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emilyzhong/derailed/statuses/{sha}","languages_url":"https://api.github.com/repos/emilyzhong/derailed/languages","stargazers_url":"https://api.github.com/repos/emilyzhong/derailed/stargazers","contributors_url":"https://api.github.com/repos/emilyzhong/derailed/contributors","subscribers_url":"https://api.github.com/repos/emilyzhong/derailed/subscribers","subscription_url":"https://api.github.com/repos/emilyzhong/derailed/subscription","commits_url":"https://api.github.com/repos/emilyzhong/derailed/commits{/sha}","git_commits_url":"https://api.github.com/repos/emilyzhong/derailed/git/commits{/sha}","comments_url":"https://api.github.com/repos/emilyzhong/derailed/comments{/number}","issue_comment_url":"https://api.github.com/repos/emilyzhong/derailed/issues/comments{/number}","contents_url":"https://api.github.com/repos/emilyzhong/derailed/contents/{+path}","compare_url":"https://api.github.com/repos/emilyzhong/derailed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emilyzhong/derailed/merges","archive_url":"https://api.github.com/repos/emilyzhong/derailed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emilyzhong/derailed/downloads","issues_url":"https://api.github.com/repos/emilyzhong/derailed/issues{/number}","pulls_url":"https://api.github.com/repos/emilyzhong/derailed/pulls{/number}","milestones_url":"https://api.github.com/repos/emilyzhong/derailed/milestones{/number}","notifications_url":"https://api.github.com/repos/emilyzhong/derailed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emilyzhong/derailed/labels{/name}","releases_url":"https://api.github.com/repos/emilyzhong/derailed/releases{/id}","deployments_url":"https://api.github.com/repos/emilyzhong/derailed/deployments","created_at":"2018-04-13T03:34:18Z","updated_at":"2018-04-21T02:12:22Z","pushed_at":"2018-04-24T11:34:52Z","git_url":"git://github.com/emilyzhong/derailed.git","ssh_url":"git@github.com:emilyzhong/derailed.git","clone_url":"https://github.com/emilyzhong/derailed.git","svn_url":"https://github.com/emilyzhong/derailed","homepage":null,"size":560,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/emilyzhong/derailed/pulls/9"},"html":{"href":"https://github.com/emilyzhong/derailed/pull/9"},"issue":{"href":"https://api.github.com/repos/emilyzhong/derailed/issues/9"},"comments":{"href":"https://api.github.com/repos/emilyzhong/derailed/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/emilyzhong/derailed/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/emilyzhong/derailed/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/emilyzhong/derailed/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/emilyzhong/derailed/statuses/d745b32e649e21dd2c516fb5f2c7624baa4d6f35"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"emilyzhong"}}