{"action":"created","comment":{"url":"https://api.github.com/repos/diaspora/diaspora/pulls/comments/217921965","pull_request_review_id":155752450,"id":217921965,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzkyMTk2NQ==","diff_hunk":"@@ -21,5 +21,17 @@ def unlock_account\n       redirect_to user_search_path, notice: t(\"admins.user_search.account_unlocking_scheduled\", name: u.username)\n     end\n \n+    def make_admin\n+      u = User.find(params[:id])\n+      Role.add_admin u\n+      redirect_to user_search_path, notice: t(\"admins.user_search.add_admin\", name: u.username)\n+    end\n+\n+    def remove_admin\n+      u = User.find(params[:id])\n+      Role.remove_admin u\n+      redirect_to user_search_path, notice: t(\"admins.user_search.delete_admin\", name: u.username)\n+    end","path":"app/controllers/admin/users_controller.rb","position":null,"original_position":14,"commit_id":"b6ad74df57dbc21f5c0d0c573de2c55e8a12c7de","original_commit_id":"02127f5990728857383bef76aefbd44075fef631","user":{"login":"zachrab","id":818143,"node_id":"MDQ6VXNlcjgxODE0Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/818143?v=4","gravatar_id":"","url":"https://api.github.com/users/zachrab","html_url":"https://github.com/zachrab","followers_url":"https://api.github.com/users/zachrab/followers","following_url":"https://api.github.com/users/zachrab/following{/other_user}","gists_url":"https://api.github.com/users/zachrab/gists{/gist_id}","starred_url":"https://api.github.com/users/zachrab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zachrab/subscriptions","organizations_url":"https://api.github.com/users/zachrab/orgs","repos_url":"https://api.github.com/users/zachrab/repos","events_url":"https://api.github.com/users/zachrab/events{/privacy}","received_events_url":"https://api.github.com/users/zachrab/received_events","type":"User","site_admin":false},"body":"@jhass added some before_action filters for the edges cases. I wasn't sure the best way to handle the already implemented roles validation...","created_at":"2018-09-16T17:33:50Z","updated_at":"2018-09-16T17:33:50Z","html_url":"https://github.com/diaspora/diaspora/pull/7868#discussion_r217921965","pull_request_url":"https://api.github.com/repos/diaspora/diaspora/pulls/7868","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/comments/217921965"},"html":{"href":"https://github.com/diaspora/diaspora/pull/7868#discussion_r217921965"},"pull_request":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/7868"}},"in_reply_to_id":217904917},"pull_request":{"url":"https://api.github.com/repos/diaspora/diaspora/pulls/7868","id":215780372,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1NzgwMzcy","html_url":"https://github.com/diaspora/diaspora/pull/7868","diff_url":"https://github.com/diaspora/diaspora/pull/7868.diff","patch_url":"https://github.com/diaspora/diaspora/pull/7868.patch","issue_url":"https://api.github.com/repos/diaspora/diaspora/issues/7868","number":7868,"state":"open","locked":false,"title":"POC for setting user roles in admin panel","user":{"login":"zachrab","id":818143,"node_id":"MDQ6VXNlcjgxODE0Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/818143?v=4","gravatar_id":"","url":"https://api.github.com/users/zachrab","html_url":"https://github.com/zachrab","followers_url":"https://api.github.com/users/zachrab/followers","following_url":"https://api.github.com/users/zachrab/following{/other_user}","gists_url":"https://api.github.com/users/zachrab/gists{/gist_id}","starred_url":"https://api.github.com/users/zachrab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zachrab/subscriptions","organizations_url":"https://api.github.com/users/zachrab/orgs","repos_url":"https://api.github.com/users/zachrab/repos","events_url":"https://api.github.com/users/zachrab/events{/privacy}","received_events_url":"https://api.github.com/users/zachrab/received_events","type":"User","site_admin":false},"body":"Initial take on issue #6391. Please provide feedback on what should be revised or if anything is missing.","created_at":"2018-09-15T17:35:57Z","updated_at":"2018-09-16T17:33:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7511c855d928f35d8a8f87505a0bf8c2c53aacb9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/diaspora/diaspora/pulls/7868/commits","review_comments_url":"https://api.github.com/repos/diaspora/diaspora/pulls/7868/comments","review_comment_url":"https://api.github.com/repos/diaspora/diaspora/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diaspora/diaspora/issues/7868/comments","statuses_url":"https://api.github.com/repos/diaspora/diaspora/statuses/b6ad74df57dbc21f5c0d0c573de2c55e8a12c7de","head":{"label":"zachrab:6391-set-user-roles-in-admin-panel","ref":"6391-set-user-roles-in-admin-panel","sha":"b6ad74df57dbc21f5c0d0c573de2c55e8a12c7de","user":{"login":"zachrab","id":818143,"node_id":"MDQ6VXNlcjgxODE0Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/818143?v=4","gravatar_id":"","url":"https://api.github.com/users/zachrab","html_url":"https://github.com/zachrab","followers_url":"https://api.github.com/users/zachrab/followers","following_url":"https://api.github.com/users/zachrab/following{/other_user}","gists_url":"https://api.github.com/users/zachrab/gists{/gist_id}","starred_url":"https://api.github.com/users/zachrab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zachrab/subscriptions","organizations_url":"https://api.github.com/users/zachrab/orgs","repos_url":"https://api.github.com/users/zachrab/repos","events_url":"https://api.github.com/users/zachrab/events{/privacy}","received_events_url":"https://api.github.com/users/zachrab/received_events","type":"User","site_admin":false},"repo":{"id":30502435,"node_id":"MDEwOlJlcG9zaXRvcnkzMDUwMjQzNQ==","name":"diaspora","full_name":"zachrab/diaspora","private":false,"owner":{"login":"zachrab","id":818143,"node_id":"MDQ6VXNlcjgxODE0Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/818143?v=4","gravatar_id":"","url":"https://api.github.com/users/zachrab","html_url":"https://github.com/zachrab","followers_url":"https://api.github.com/users/zachrab/followers","following_url":"https://api.github.com/users/zachrab/following{/other_user}","gists_url":"https://api.github.com/users/zachrab/gists{/gist_id}","starred_url":"https://api.github.com/users/zachrab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zachrab/subscriptions","organizations_url":"https://api.github.com/users/zachrab/orgs","repos_url":"https://api.github.com/users/zachrab/repos","events_url":"https://api.github.com/users/zachrab/events{/privacy}","received_events_url":"https://api.github.com/users/zachrab/received_events","type":"User","site_admin":false},"html_url":"https://github.com/zachrab/diaspora","description":"Distributed and contextual social networking","fork":true,"url":"https://api.github.com/repos/zachrab/diaspora","forks_url":"https://api.github.com/repos/zachrab/diaspora/forks","keys_url":"https://api.github.com/repos/zachrab/diaspora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zachrab/diaspora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zachrab/diaspora/teams","hooks_url":"https://api.github.com/repos/zachrab/diaspora/hooks","issue_events_url":"https://api.github.com/repos/zachrab/diaspora/issues/events{/number}","events_url":"https://api.github.com/repos/zachrab/diaspora/events","assignees_url":"https://api.github.com/repos/zachrab/diaspora/assignees{/user}","branches_url":"https://api.github.com/repos/zachrab/diaspora/branches{/branch}","tags_url":"https://api.github.com/repos/zachrab/diaspora/tags","blobs_url":"https://api.github.com/repos/zachrab/diaspora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zachrab/diaspora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zachrab/diaspora/git/refs{/sha}","trees_url":"https://api.github.com/repos/zachrab/diaspora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zachrab/diaspora/statuses/{sha}","languages_url":"https://api.github.com/repos/zachrab/diaspora/languages","stargazers_url":"https://api.github.com/repos/zachrab/diaspora/stargazers","contributors_url":"https://api.github.com/repos/zachrab/diaspora/contributors","subscribers_url":"https://api.github.com/repos/zachrab/diaspora/subscribers","subscription_url":"https://api.github.com/repos/zachrab/diaspora/subscription","commits_url":"https://api.github.com/repos/zachrab/diaspora/commits{/sha}","git_commits_url":"https://api.github.com/repos/zachrab/diaspora/git/commits{/sha}","comments_url":"https://api.github.com/repos/zachrab/diaspora/comments{/number}","issue_comment_url":"https://api.github.com/repos/zachrab/diaspora/issues/comments{/number}","contents_url":"https://api.github.com/repos/zachrab/diaspora/contents/{+path}","compare_url":"https://api.github.com/repos/zachrab/diaspora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zachrab/diaspora/merges","archive_url":"https://api.github.com/repos/zachrab/diaspora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zachrab/diaspora/downloads","issues_url":"https://api.github.com/repos/zachrab/diaspora/issues{/number}","pulls_url":"https://api.github.com/repos/zachrab/diaspora/pulls{/number}","milestones_url":"https://api.github.com/repos/zachrab/diaspora/milestones{/number}","notifications_url":"https://api.github.com/repos/zachrab/diaspora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zachrab/diaspora/labels{/name}","releases_url":"https://api.github.com/repos/zachrab/diaspora/releases{/id}","deployments_url":"https://api.github.com/repos/zachrab/diaspora/deployments","created_at":"2015-02-08T19:20:45Z","updated_at":"2018-09-08T17:57:39Z","pushed_at":"2018-09-16T17:27:50Z","git_url":"git://github.com/zachrab/diaspora.git","ssh_url":"git@github.com:zachrab/diaspora.git","clone_url":"https://github.com/zachrab/diaspora.git","svn_url":"https://github.com/zachrab/diaspora","homepage":"https://diasporafoundation.org/","size":104985,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"diaspora:develop","ref":"develop","sha":"026e63b961ed3e293b75d233e763e4b062acc262","user":{"login":"diaspora","id":293207,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MzIwNw==","avatar_url":"https://avatars3.githubusercontent.com/u/293207?v=4","gravatar_id":"","url":"https://api.github.com/users/diaspora","html_url":"https://github.com/diaspora","followers_url":"https://api.github.com/users/diaspora/followers","following_url":"https://api.github.com/users/diaspora/following{/other_user}","gists_url":"https://api.github.com/users/diaspora/gists{/gist_id}","starred_url":"https://api.github.com/users/diaspora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diaspora/subscriptions","organizations_url":"https://api.github.com/users/diaspora/orgs","repos_url":"https://api.github.com/users/diaspora/repos","events_url":"https://api.github.com/users/diaspora/events{/privacy}","received_events_url":"https://api.github.com/users/diaspora/received_events","type":"Organization","site_admin":false},"repo":{"id":911765,"node_id":"MDEwOlJlcG9zaXRvcnk5MTE3NjU=","name":"diaspora","full_name":"diaspora/diaspora","private":false,"owner":{"login":"diaspora","id":293207,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MzIwNw==","avatar_url":"https://avatars3.githubusercontent.com/u/293207?v=4","gravatar_id":"","url":"https://api.github.com/users/diaspora","html_url":"https://github.com/diaspora","followers_url":"https://api.github.com/users/diaspora/followers","following_url":"https://api.github.com/users/diaspora/following{/other_user}","gists_url":"https://api.github.com/users/diaspora/gists{/gist_id}","starred_url":"https://api.github.com/users/diaspora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diaspora/subscriptions","organizations_url":"https://api.github.com/users/diaspora/orgs","repos_url":"https://api.github.com/users/diaspora/repos","events_url":"https://api.github.com/users/diaspora/events{/privacy}","received_events_url":"https://api.github.com/users/diaspora/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/diaspora/diaspora","description":"A privacy-aware, distributed, open source social network.","fork":false,"url":"https://api.github.com/repos/diaspora/diaspora","forks_url":"https://api.github.com/repos/diaspora/diaspora/forks","keys_url":"https://api.github.com/repos/diaspora/diaspora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diaspora/diaspora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diaspora/diaspora/teams","hooks_url":"https://api.github.com/repos/diaspora/diaspora/hooks","issue_events_url":"https://api.github.com/repos/diaspora/diaspora/issues/events{/number}","events_url":"https://api.github.com/repos/diaspora/diaspora/events","assignees_url":"https://api.github.com/repos/diaspora/diaspora/assignees{/user}","branches_url":"https://api.github.com/repos/diaspora/diaspora/branches{/branch}","tags_url":"https://api.github.com/repos/diaspora/diaspora/tags","blobs_url":"https://api.github.com/repos/diaspora/diaspora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diaspora/diaspora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diaspora/diaspora/git/refs{/sha}","trees_url":"https://api.github.com/repos/diaspora/diaspora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diaspora/diaspora/statuses/{sha}","languages_url":"https://api.github.com/repos/diaspora/diaspora/languages","stargazers_url":"https://api.github.com/repos/diaspora/diaspora/stargazers","contributors_url":"https://api.github.com/repos/diaspora/diaspora/contributors","subscribers_url":"https://api.github.com/repos/diaspora/diaspora/subscribers","subscription_url":"https://api.github.com/repos/diaspora/diaspora/subscription","commits_url":"https://api.github.com/repos/diaspora/diaspora/commits{/sha}","git_commits_url":"https://api.github.com/repos/diaspora/diaspora/git/commits{/sha}","comments_url":"https://api.github.com/repos/diaspora/diaspora/comments{/number}","issue_comment_url":"https://api.github.com/repos/diaspora/diaspora/issues/comments{/number}","contents_url":"https://api.github.com/repos/diaspora/diaspora/contents/{+path}","compare_url":"https://api.github.com/repos/diaspora/diaspora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diaspora/diaspora/merges","archive_url":"https://api.github.com/repos/diaspora/diaspora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diaspora/diaspora/downloads","issues_url":"https://api.github.com/repos/diaspora/diaspora/issues{/number}","pulls_url":"https://api.github.com/repos/diaspora/diaspora/pulls{/number}","milestones_url":"https://api.github.com/repos/diaspora/diaspora/milestones{/number}","notifications_url":"https://api.github.com/repos/diaspora/diaspora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diaspora/diaspora/labels{/name}","releases_url":"https://api.github.com/repos/diaspora/diaspora/releases{/id}","deployments_url":"https://api.github.com/repos/diaspora/diaspora/deployments","created_at":"2010-09-15T05:20:04Z","updated_at":"2018-09-16T09:07:05Z","pushed_at":"2018-09-16T17:27:56Z","git_url":"git://github.com/diaspora/diaspora.git","ssh_url":"git@github.com:diaspora/diaspora.git","clone_url":"https://github.com/diaspora/diaspora.git","svn_url":"https://github.com/diaspora/diaspora","homepage":"https://diasporafoundation.org/","size":104780,"stargazers_count":11952,"watchers_count":11952,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2887,"mirror_url":null,"archived":false,"open_issues_count":423,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2887,"open_issues":423,"watchers":11952,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/7868"},"html":{"href":"https://github.com/diaspora/diaspora/pull/7868"},"issue":{"href":"https://api.github.com/repos/diaspora/diaspora/issues/7868"},"comments":{"href":"https://api.github.com/repos/diaspora/diaspora/issues/7868/comments"},"review_comments":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/7868/comments"},"review_comment":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/7868/commits"},"statuses":{"href":"https://api.github.com/repos/diaspora/diaspora/statuses/b6ad74df57dbc21f5c0d0c573de2c55e8a12c7de"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"zachrab"}}