{"action":"created","comment":{"url":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/comments/167522040","pull_request_review_id":95751444,"id":167522040,"diff_hunk":"@@ -22,17 +22,28 @@ def admin_index\n   # Permissions which the user already has are pre-selected\n   # Selecting new permissions and saving calls the admin_update_permissions action\n   def admin_grant_permissions\n-    @user = User.includes(:perms, :roles).find(params[:id])\n-    authorize @user\n+    user = User.includes(:perms).find(params[:id])\n+    authorize user\n     user_perms = current_user.perms\n-    @perms = user_perms & [Perm.grant_permissions, Perm.modify_templates, Perm.modify_guidance, \n-                           Perm.use_api, Perm.change_org_details, Perm.add_orgs, \n-                           Perm.change_affiliation, Perm.grant_api]\n+    \n+    # Super admin can grant any Perm, org admins can only grant Perms they\n+    # themselves have access to\n+    if current_user.can_super_admin?\n+      perms = Perm.all\n+    else\n+      perms = current_user.perms","path":"app/controllers/users_controller.rb","position":30,"original_position":30,"commit_id":"fe571d180b056bbecc6ad24c77323e54d7fa2bba","original_commit_id":"fe571d180b056bbecc6ad24c77323e54d7fa2bba","user":{"login":"jollopre","id":7393044,"avatar_url":"https://avatars1.githubusercontent.com/u/7393044?v=4","gravatar_id":"","url":"https://api.github.com/users/jollopre","html_url":"https://github.com/jollopre","followers_url":"https://api.github.com/users/jollopre/followers","following_url":"https://api.github.com/users/jollopre/following{/other_user}","gists_url":"https://api.github.com/users/jollopre/gists{/gist_id}","starred_url":"https://api.github.com/users/jollopre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jollopre/subscriptions","organizations_url":"https://api.github.com/users/jollopre/orgs","repos_url":"https://api.github.com/users/jollopre/repos","events_url":"https://api.github.com/users/jollopre/events{/privacy}","received_events_url":"https://api.github.com/users/jollopre/received_events","type":"User","site_admin":false},"body":"you have user_perms above referencing the same thing","created_at":"2018-02-12T11:00:40Z","updated_at":"2018-02-12T11:00:41Z","html_url":"https://github.com/DMPRoadmap/roadmap/pull/1142#discussion_r167522040","pull_request_url":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/1142","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/comments/167522040"},"html":{"href":"https://github.com/DMPRoadmap/roadmap/pull/1142#discussion_r167522040"},"pull_request":{"href":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/1142"}}},"pull_request":{"url":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/1142","id":168330926,"html_url":"https://github.com/DMPRoadmap/roadmap/pull/1142","diff_url":"https://github.com/DMPRoadmap/roadmap/pull/1142.diff","patch_url":"https://github.com/DMPRoadmap/roadmap/pull/1142.patch","issue_url":"https://api.github.com/repos/DMPRoadmap/roadmap/issues/1142","number":1142,"state":"open","locked":false,"title":"fixes to edit user privileges","user":{"login":"briri","id":1204467,"avatar_url":"https://avatars2.githubusercontent.com/u/1204467?v=4","gravatar_id":"","url":"https://api.github.com/users/briri","html_url":"https://github.com/briri","followers_url":"https://api.github.com/users/briri/followers","following_url":"https://api.github.com/users/briri/following{/other_user}","gists_url":"https://api.github.com/users/briri/gists{/gist_id}","starred_url":"https://api.github.com/users/briri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briri/subscriptions","organizations_url":"https://api.github.com/users/briri/orgs","repos_url":"https://api.github.com/users/briri/repos","events_url":"https://api.github.com/users/briri/events{/privacy}","received_events_url":"https://api.github.com/users/briri/received_events","type":"User","site_admin":false},"body":"#794 \r\n- Org admin users no longer see the 'Edit' link for Super Admins\r\n- Org admins can now only grant/revoke privileges that they themselves have access to\r\n","created_at":"2018-02-09T20:07:13Z","updated_at":"2018-02-12T11:00:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"19864a42ea32154f0800aee1d0644abf6d9163a3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/1142/commits","review_comments_url":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/1142/comments","review_comment_url":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DMPRoadmap/roadmap/issues/1142/comments","statuses_url":"https://api.github.com/repos/DMPRoadmap/roadmap/statuses/fe571d180b056bbecc6ad24c77323e54d7fa2bba","head":{"label":"CDLUC3:issue794","ref":"issue794","sha":"fe571d180b056bbecc6ad24c77323e54d7fa2bba","user":{"login":"CDLUC3","id":6484675,"avatar_url":"https://avatars2.githubusercontent.com/u/6484675?v=4","gravatar_id":"","url":"https://api.github.com/users/CDLUC3","html_url":"https://github.com/CDLUC3","followers_url":"https://api.github.com/users/CDLUC3/followers","following_url":"https://api.github.com/users/CDLUC3/following{/other_user}","gists_url":"https://api.github.com/users/CDLUC3/gists{/gist_id}","starred_url":"https://api.github.com/users/CDLUC3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CDLUC3/subscriptions","organizations_url":"https://api.github.com/users/CDLUC3/orgs","repos_url":"https://api.github.com/users/CDLUC3/repos","events_url":"https://api.github.com/users/CDLUC3/events{/privacy}","received_events_url":"https://api.github.com/users/CDLUC3/received_events","type":"Organization","site_admin":false},"repo":{"id":60374899,"name":"roadmap","full_name":"CDLUC3/roadmap","owner":{"login":"CDLUC3","id":6484675,"avatar_url":"https://avatars2.githubusercontent.com/u/6484675?v=4","gravatar_id":"","url":"https://api.github.com/users/CDLUC3","html_url":"https://github.com/CDLUC3","followers_url":"https://api.github.com/users/CDLUC3/followers","following_url":"https://api.github.com/users/CDLUC3/following{/other_user}","gists_url":"https://api.github.com/users/CDLUC3/gists{/gist_id}","starred_url":"https://api.github.com/users/CDLUC3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CDLUC3/subscriptions","organizations_url":"https://api.github.com/users/CDLUC3/orgs","repos_url":"https://api.github.com/users/CDLUC3/repos","events_url":"https://api.github.com/users/CDLUC3/events{/privacy}","received_events_url":"https://api.github.com/users/CDLUC3/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CDLUC3/roadmap","description":"DCC/UC3 collaboration for a data management planning tool ","fork":true,"url":"https://api.github.com/repos/CDLUC3/roadmap","forks_url":"https://api.github.com/repos/CDLUC3/roadmap/forks","keys_url":"https://api.github.com/repos/CDLUC3/roadmap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CDLUC3/roadmap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CDLUC3/roadmap/teams","hooks_url":"https://api.github.com/repos/CDLUC3/roadmap/hooks","issue_events_url":"https://api.github.com/repos/CDLUC3/roadmap/issues/events{/number}","events_url":"https://api.github.com/repos/CDLUC3/roadmap/events","assignees_url":"https://api.github.com/repos/CDLUC3/roadmap/assignees{/user}","branches_url":"https://api.github.com/repos/CDLUC3/roadmap/branches{/branch}","tags_url":"https://api.github.com/repos/CDLUC3/roadmap/tags","blobs_url":"https://api.github.com/repos/CDLUC3/roadmap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CDLUC3/roadmap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CDLUC3/roadmap/git/refs{/sha}","trees_url":"https://api.github.com/repos/CDLUC3/roadmap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CDLUC3/roadmap/statuses/{sha}","languages_url":"https://api.github.com/repos/CDLUC3/roadmap/languages","stargazers_url":"https://api.github.com/repos/CDLUC3/roadmap/stargazers","contributors_url":"https://api.github.com/repos/CDLUC3/roadmap/contributors","subscribers_url":"https://api.github.com/repos/CDLUC3/roadmap/subscribers","subscription_url":"https://api.github.com/repos/CDLUC3/roadmap/subscription","commits_url":"https://api.github.com/repos/CDLUC3/roadmap/commits{/sha}","git_commits_url":"https://api.github.com/repos/CDLUC3/roadmap/git/commits{/sha}","comments_url":"https://api.github.com/repos/CDLUC3/roadmap/comments{/number}","issue_comment_url":"https://api.github.com/repos/CDLUC3/roadmap/issues/comments{/number}","contents_url":"https://api.github.com/repos/CDLUC3/roadmap/contents/{+path}","compare_url":"https://api.github.com/repos/CDLUC3/roadmap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CDLUC3/roadmap/merges","archive_url":"https://api.github.com/repos/CDLUC3/roadmap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CDLUC3/roadmap/downloads","issues_url":"https://api.github.com/repos/CDLUC3/roadmap/issues{/number}","pulls_url":"https://api.github.com/repos/CDLUC3/roadmap/pulls{/number}","milestones_url":"https://api.github.com/repos/CDLUC3/roadmap/milestones{/number}","notifications_url":"https://api.github.com/repos/CDLUC3/roadmap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CDLUC3/roadmap/labels{/name}","releases_url":"https://api.github.com/repos/CDLUC3/roadmap/releases{/id}","deployments_url":"https://api.github.com/repos/CDLUC3/roadmap/deployments","created_at":"2016-06-03T20:11:00Z","updated_at":"2018-01-08T18:17:41Z","pushed_at":"2018-02-09T23:57:41Z","git_url":"git://github.com/CDLUC3/roadmap.git","ssh_url":"git@github.com:CDLUC3/roadmap.git","clone_url":"https://github.com/CDLUC3/roadmap.git","svn_url":"https://github.com/CDLUC3/roadmap","homepage":null,"size":65191,"stargazers_count":1,"watchers_count":1,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"DMPRoadmap:development","ref":"development","sha":"9f398a59141ceb8da08fab84173d889603cf085d","user":{"login":"DMPRoadmap","id":19314450,"avatar_url":"https://avatars0.githubusercontent.com/u/19314450?v=4","gravatar_id":"","url":"https://api.github.com/users/DMPRoadmap","html_url":"https://github.com/DMPRoadmap","followers_url":"https://api.github.com/users/DMPRoadmap/followers","following_url":"https://api.github.com/users/DMPRoadmap/following{/other_user}","gists_url":"https://api.github.com/users/DMPRoadmap/gists{/gist_id}","starred_url":"https://api.github.com/users/DMPRoadmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DMPRoadmap/subscriptions","organizations_url":"https://api.github.com/users/DMPRoadmap/orgs","repos_url":"https://api.github.com/users/DMPRoadmap/repos","events_url":"https://api.github.com/users/DMPRoadmap/events{/privacy}","received_events_url":"https://api.github.com/users/DMPRoadmap/received_events","type":"Organization","site_admin":false},"repo":{"id":58585337,"name":"roadmap","full_name":"DMPRoadmap/roadmap","owner":{"login":"DMPRoadmap","id":19314450,"avatar_url":"https://avatars0.githubusercontent.com/u/19314450?v=4","gravatar_id":"","url":"https://api.github.com/users/DMPRoadmap","html_url":"https://github.com/DMPRoadmap","followers_url":"https://api.github.com/users/DMPRoadmap/followers","following_url":"https://api.github.com/users/DMPRoadmap/following{/other_user}","gists_url":"https://api.github.com/users/DMPRoadmap/gists{/gist_id}","starred_url":"https://api.github.com/users/DMPRoadmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DMPRoadmap/subscriptions","organizations_url":"https://api.github.com/users/DMPRoadmap/orgs","repos_url":"https://api.github.com/users/DMPRoadmap/repos","events_url":"https://api.github.com/users/DMPRoadmap/events{/privacy}","received_events_url":"https://api.github.com/users/DMPRoadmap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DMPRoadmap/roadmap","description":"DCC/UC3 collaboration for a data management planning tool ","fork":false,"url":"https://api.github.com/repos/DMPRoadmap/roadmap","forks_url":"https://api.github.com/repos/DMPRoadmap/roadmap/forks","keys_url":"https://api.github.com/repos/DMPRoadmap/roadmap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DMPRoadmap/roadmap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DMPRoadmap/roadmap/teams","hooks_url":"https://api.github.com/repos/DMPRoadmap/roadmap/hooks","issue_events_url":"https://api.github.com/repos/DMPRoadmap/roadmap/issues/events{/number}","events_url":"https://api.github.com/repos/DMPRoadmap/roadmap/events","assignees_url":"https://api.github.com/repos/DMPRoadmap/roadmap/assignees{/user}","branches_url":"https://api.github.com/repos/DMPRoadmap/roadmap/branches{/branch}","tags_url":"https://api.github.com/repos/DMPRoadmap/roadmap/tags","blobs_url":"https://api.github.com/repos/DMPRoadmap/roadmap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DMPRoadmap/roadmap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DMPRoadmap/roadmap/git/refs{/sha}","trees_url":"https://api.github.com/repos/DMPRoadmap/roadmap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DMPRoadmap/roadmap/statuses/{sha}","languages_url":"https://api.github.com/repos/DMPRoadmap/roadmap/languages","stargazers_url":"https://api.github.com/repos/DMPRoadmap/roadmap/stargazers","contributors_url":"https://api.github.com/repos/DMPRoadmap/roadmap/contributors","subscribers_url":"https://api.github.com/repos/DMPRoadmap/roadmap/subscribers","subscription_url":"https://api.github.com/repos/DMPRoadmap/roadmap/subscription","commits_url":"https://api.github.com/repos/DMPRoadmap/roadmap/commits{/sha}","git_commits_url":"https://api.github.com/repos/DMPRoadmap/roadmap/git/commits{/sha}","comments_url":"https://api.github.com/repos/DMPRoadmap/roadmap/comments{/number}","issue_comment_url":"https://api.github.com/repos/DMPRoadmap/roadmap/issues/comments{/number}","contents_url":"https://api.github.com/repos/DMPRoadmap/roadmap/contents/{+path}","compare_url":"https://api.github.com/repos/DMPRoadmap/roadmap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DMPRoadmap/roadmap/merges","archive_url":"https://api.github.com/repos/DMPRoadmap/roadmap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DMPRoadmap/roadmap/downloads","issues_url":"https://api.github.com/repos/DMPRoadmap/roadmap/issues{/number}","pulls_url":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls{/number}","milestones_url":"https://api.github.com/repos/DMPRoadmap/roadmap/milestones{/number}","notifications_url":"https://api.github.com/repos/DMPRoadmap/roadmap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DMPRoadmap/roadmap/labels{/name}","releases_url":"https://api.github.com/repos/DMPRoadmap/roadmap/releases{/id}","deployments_url":"https://api.github.com/repos/DMPRoadmap/roadmap/deployments","created_at":"2016-05-11T22:01:32Z","updated_at":"2018-02-01T10:42:58Z","pushed_at":"2018-02-12T10:10:19Z","git_url":"git://github.com/DMPRoadmap/roadmap.git","ssh_url":"git@github.com:DMPRoadmap/roadmap.git","clone_url":"https://github.com/DMPRoadmap/roadmap.git","svn_url":"https://github.com/DMPRoadmap/roadmap","homepage":null,"size":64487,"stargazers_count":19,"watchers_count":19,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"archived":false,"open_issues_count":113,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":24,"open_issues":113,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/1142"},"html":{"href":"https://github.com/DMPRoadmap/roadmap/pull/1142"},"issue":{"href":"https://api.github.com/repos/DMPRoadmap/roadmap/issues/1142"},"comments":{"href":"https://api.github.com/repos/DMPRoadmap/roadmap/issues/1142/comments"},"review_comments":{"href":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/1142/comments"},"review_comment":{"href":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DMPRoadmap/roadmap/pulls/1142/commits"},"statuses":{"href":"https://api.github.com/repos/DMPRoadmap/roadmap/statuses/fe571d180b056bbecc6ad24c77323e54d7fa2bba"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jollopre"}}