{"action":"created","comment":{"url":"https://api.github.com/repos/jencheng/blue-engine/pulls/comments/23241863","id":23241863,"diff_hunk":"@@ -19,7 +18,14 @@ def create\n   private\n \n   def user_params\n-    params.require(:user).permit(:email, :password)\n+    params.require(:user).permit(:email, :password, :name, :admin)\n   end\n+  \n+  def dissallow_non_admin\n+    if not current_user.admin?","path":"app/controllers/users_controller.rb","position":31,"original_position":31,"commit_id":"37e12c57f16891c59dcc3072a3dbd5a424b38c97","original_commit_id":"37e12c57f16891c59dcc3072a3dbd5a424b38c97","user":{"login":"hrs","id":278853,"avatar_url":"https://avatars.githubusercontent.com/u/278853?v=3","gravatar_id":"","url":"https://api.github.com/users/hrs","html_url":"https://github.com/hrs","followers_url":"https://api.github.com/users/hrs/followers","following_url":"https://api.github.com/users/hrs/following{/other_user}","gists_url":"https://api.github.com/users/hrs/gists{/gist_id}","starred_url":"https://api.github.com/users/hrs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrs/subscriptions","organizations_url":"https://api.github.com/users/hrs/orgs","repos_url":"https://api.github.com/users/hrs/repos","events_url":"https://api.github.com/users/hrs/events{/privacy}","received_events_url":"https://api.github.com/users/hrs/received_events","type":"User","site_admin":false},"body":"How about the positive form, `if current_user.instructor?`?","created_at":"2015-01-20T18:10:57Z","updated_at":"2015-01-20T18:10:57Z","html_url":"https://github.com/jencheng/blue-engine/pull/1#discussion_r23241863","pull_request_url":"https://api.github.com/repos/jencheng/blue-engine/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/jencheng/blue-engine/pulls/comments/23241863"},"html":{"href":"https://github.com/jencheng/blue-engine/pull/1#discussion_r23241863"},"pull_request":{"href":"https://api.github.com/repos/jencheng/blue-engine/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/jencheng/blue-engine/pulls/1","id":27689617,"html_url":"https://github.com/jencheng/blue-engine/pull/1","diff_url":"https://github.com/jencheng/blue-engine/pull/1.diff","patch_url":"https://github.com/jencheng/blue-engine/pull/1.patch","issue_url":"https://api.github.com/repos/jencheng/blue-engine/issues/1","number":1,"state":"closed","locked":false,"title":"Only permit admin to create new users","user":{"login":"jencheng","id":1734048,"avatar_url":"https://avatars.githubusercontent.com/u/1734048?v=3","gravatar_id":"","url":"https://api.github.com/users/jencheng","html_url":"https://github.com/jencheng","followers_url":"https://api.github.com/users/jencheng/followers","following_url":"https://api.github.com/users/jencheng/following{/other_user}","gists_url":"https://api.github.com/users/jencheng/gists{/gist_id}","starred_url":"https://api.github.com/users/jencheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jencheng/subscriptions","organizations_url":"https://api.github.com/users/jencheng/orgs","repos_url":"https://api.github.com/users/jencheng/repos","events_url":"https://api.github.com/users/jencheng/events{/privacy}","received_events_url":"https://api.github.com/users/jencheng/received_events","type":"User","site_admin":false},"body":"* Admin can create new user accounts\r\n* Prevent instructors from creating new user accounts\r\n\r\n@hrs\r\n\r\nI couldn't get rspec to detect my new feature test, without explicitly calling `rspec foo.rb`. Am I missing a setting? Also, I couldn't get the feature test with the flash message `New user created: #{new_user_name}` to pass. Does `have_content` detect flash messages?","created_at":"2015-01-20T16:14:38Z","updated_at":"2015-01-20T18:10:57Z","closed_at":"2015-01-20T18:00:36Z","merged_at":null,"merge_commit_sha":"05d555c2da33c06372da8544602c9d06e7f1466a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jencheng/blue-engine/pulls/1/commits","review_comments_url":"https://api.github.com/repos/jencheng/blue-engine/pulls/1/comments","review_comment_url":"https://api.github.com/repos/jencheng/blue-engine/pulls/comments/{number}","comments_url":"https://api.github.com/repos/jencheng/blue-engine/issues/1/comments","statuses_url":"https://api.github.com/repos/jencheng/blue-engine/statuses/37e12c57f16891c59dcc3072a3dbd5a424b38c97","head":{"label":"jencheng:create_new_users","ref":"create_new_users","sha":"37e12c57f16891c59dcc3072a3dbd5a424b38c97","user":{"login":"jencheng","id":1734048,"avatar_url":"https://avatars.githubusercontent.com/u/1734048?v=3","gravatar_id":"","url":"https://api.github.com/users/jencheng","html_url":"https://github.com/jencheng","followers_url":"https://api.github.com/users/jencheng/followers","following_url":"https://api.github.com/users/jencheng/following{/other_user}","gists_url":"https://api.github.com/users/jencheng/gists{/gist_id}","starred_url":"https://api.github.com/users/jencheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jencheng/subscriptions","organizations_url":"https://api.github.com/users/jencheng/orgs","repos_url":"https://api.github.com/users/jencheng/repos","events_url":"https://api.github.com/users/jencheng/events{/privacy}","received_events_url":"https://api.github.com/users/jencheng/received_events","type":"User","site_admin":false},"repo":{"id":29505939,"name":"blue-engine","full_name":"jencheng/blue-engine","owner":{"login":"jencheng","id":1734048,"avatar_url":"https://avatars.githubusercontent.com/u/1734048?v=3","gravatar_id":"","url":"https://api.github.com/users/jencheng","html_url":"https://github.com/jencheng","followers_url":"https://api.github.com/users/jencheng/followers","following_url":"https://api.github.com/users/jencheng/following{/other_user}","gists_url":"https://api.github.com/users/jencheng/gists{/gist_id}","starred_url":"https://api.github.com/users/jencheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jencheng/subscriptions","organizations_url":"https://api.github.com/users/jencheng/orgs","repos_url":"https://api.github.com/users/jencheng/repos","events_url":"https://api.github.com/users/jencheng/events{/privacy}","received_events_url":"https://api.github.com/users/jencheng/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jencheng/blue-engine","description":"","fork":false,"url":"https://api.github.com/repos/jencheng/blue-engine","forks_url":"https://api.github.com/repos/jencheng/blue-engine/forks","keys_url":"https://api.github.com/repos/jencheng/blue-engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jencheng/blue-engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jencheng/blue-engine/teams","hooks_url":"https://api.github.com/repos/jencheng/blue-engine/hooks","issue_events_url":"https://api.github.com/repos/jencheng/blue-engine/issues/events{/number}","events_url":"https://api.github.com/repos/jencheng/blue-engine/events","assignees_url":"https://api.github.com/repos/jencheng/blue-engine/assignees{/user}","branches_url":"https://api.github.com/repos/jencheng/blue-engine/branches{/branch}","tags_url":"https://api.github.com/repos/jencheng/blue-engine/tags","blobs_url":"https://api.github.com/repos/jencheng/blue-engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jencheng/blue-engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jencheng/blue-engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/jencheng/blue-engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jencheng/blue-engine/statuses/{sha}","languages_url":"https://api.github.com/repos/jencheng/blue-engine/languages","stargazers_url":"https://api.github.com/repos/jencheng/blue-engine/stargazers","contributors_url":"https://api.github.com/repos/jencheng/blue-engine/contributors","subscribers_url":"https://api.github.com/repos/jencheng/blue-engine/subscribers","subscription_url":"https://api.github.com/repos/jencheng/blue-engine/subscription","commits_url":"https://api.github.com/repos/jencheng/blue-engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/jencheng/blue-engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/jencheng/blue-engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/jencheng/blue-engine/issues/comments/{number}","contents_url":"https://api.github.com/repos/jencheng/blue-engine/contents/{+path}","compare_url":"https://api.github.com/repos/jencheng/blue-engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jencheng/blue-engine/merges","archive_url":"https://api.github.com/repos/jencheng/blue-engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jencheng/blue-engine/downloads","issues_url":"https://api.github.com/repos/jencheng/blue-engine/issues{/number}","pulls_url":"https://api.github.com/repos/jencheng/blue-engine/pulls{/number}","milestones_url":"https://api.github.com/repos/jencheng/blue-engine/milestones{/number}","notifications_url":"https://api.github.com/repos/jencheng/blue-engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jencheng/blue-engine/labels{/name}","releases_url":"https://api.github.com/repos/jencheng/blue-engine/releases{/id}","created_at":"2015-01-20T01:37:50Z","updated_at":"2015-01-20T17:59:25Z","pushed_at":"2015-01-20T18:00:39Z","git_url":"git://github.com/jencheng/blue-engine.git","ssh_url":"git@github.com:jencheng/blue-engine.git","clone_url":"https://github.com/jencheng/blue-engine.git","svn_url":"https://github.com/jencheng/blue-engine","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"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":"jencheng:master","ref":"master","sha":"6b97a077ab0c2e17f4507b357410513eaa012cd8","user":{"login":"jencheng","id":1734048,"avatar_url":"https://avatars.githubusercontent.com/u/1734048?v=3","gravatar_id":"","url":"https://api.github.com/users/jencheng","html_url":"https://github.com/jencheng","followers_url":"https://api.github.com/users/jencheng/followers","following_url":"https://api.github.com/users/jencheng/following{/other_user}","gists_url":"https://api.github.com/users/jencheng/gists{/gist_id}","starred_url":"https://api.github.com/users/jencheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jencheng/subscriptions","organizations_url":"https://api.github.com/users/jencheng/orgs","repos_url":"https://api.github.com/users/jencheng/repos","events_url":"https://api.github.com/users/jencheng/events{/privacy}","received_events_url":"https://api.github.com/users/jencheng/received_events","type":"User","site_admin":false},"repo":{"id":29505939,"name":"blue-engine","full_name":"jencheng/blue-engine","owner":{"login":"jencheng","id":1734048,"avatar_url":"https://avatars.githubusercontent.com/u/1734048?v=3","gravatar_id":"","url":"https://api.github.com/users/jencheng","html_url":"https://github.com/jencheng","followers_url":"https://api.github.com/users/jencheng/followers","following_url":"https://api.github.com/users/jencheng/following{/other_user}","gists_url":"https://api.github.com/users/jencheng/gists{/gist_id}","starred_url":"https://api.github.com/users/jencheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jencheng/subscriptions","organizations_url":"https://api.github.com/users/jencheng/orgs","repos_url":"https://api.github.com/users/jencheng/repos","events_url":"https://api.github.com/users/jencheng/events{/privacy}","received_events_url":"https://api.github.com/users/jencheng/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jencheng/blue-engine","description":"","fork":false,"url":"https://api.github.com/repos/jencheng/blue-engine","forks_url":"https://api.github.com/repos/jencheng/blue-engine/forks","keys_url":"https://api.github.com/repos/jencheng/blue-engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jencheng/blue-engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jencheng/blue-engine/teams","hooks_url":"https://api.github.com/repos/jencheng/blue-engine/hooks","issue_events_url":"https://api.github.com/repos/jencheng/blue-engine/issues/events{/number}","events_url":"https://api.github.com/repos/jencheng/blue-engine/events","assignees_url":"https://api.github.com/repos/jencheng/blue-engine/assignees{/user}","branches_url":"https://api.github.com/repos/jencheng/blue-engine/branches{/branch}","tags_url":"https://api.github.com/repos/jencheng/blue-engine/tags","blobs_url":"https://api.github.com/repos/jencheng/blue-engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jencheng/blue-engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jencheng/blue-engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/jencheng/blue-engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jencheng/blue-engine/statuses/{sha}","languages_url":"https://api.github.com/repos/jencheng/blue-engine/languages","stargazers_url":"https://api.github.com/repos/jencheng/blue-engine/stargazers","contributors_url":"https://api.github.com/repos/jencheng/blue-engine/contributors","subscribers_url":"https://api.github.com/repos/jencheng/blue-engine/subscribers","subscription_url":"https://api.github.com/repos/jencheng/blue-engine/subscription","commits_url":"https://api.github.com/repos/jencheng/blue-engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/jencheng/blue-engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/jencheng/blue-engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/jencheng/blue-engine/issues/comments/{number}","contents_url":"https://api.github.com/repos/jencheng/blue-engine/contents/{+path}","compare_url":"https://api.github.com/repos/jencheng/blue-engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jencheng/blue-engine/merges","archive_url":"https://api.github.com/repos/jencheng/blue-engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jencheng/blue-engine/downloads","issues_url":"https://api.github.com/repos/jencheng/blue-engine/issues{/number}","pulls_url":"https://api.github.com/repos/jencheng/blue-engine/pulls{/number}","milestones_url":"https://api.github.com/repos/jencheng/blue-engine/milestones{/number}","notifications_url":"https://api.github.com/repos/jencheng/blue-engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jencheng/blue-engine/labels{/name}","releases_url":"https://api.github.com/repos/jencheng/blue-engine/releases{/id}","created_at":"2015-01-20T01:37:50Z","updated_at":"2015-01-20T17:59:25Z","pushed_at":"2015-01-20T18:00:39Z","git_url":"git://github.com/jencheng/blue-engine.git","ssh_url":"git@github.com:jencheng/blue-engine.git","clone_url":"https://github.com/jencheng/blue-engine.git","svn_url":"https://github.com/jencheng/blue-engine","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jencheng/blue-engine/pulls/1"},"html":{"href":"https://github.com/jencheng/blue-engine/pull/1"},"issue":{"href":"https://api.github.com/repos/jencheng/blue-engine/issues/1"},"comments":{"href":"https://api.github.com/repos/jencheng/blue-engine/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/jencheng/blue-engine/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/jencheng/blue-engine/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/jencheng/blue-engine/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/jencheng/blue-engine/statuses/37e12c57f16891c59dcc3072a3dbd5a424b38c97"}}}}