{"action":"created","comment":{"url":"https://api.github.com/repos/oppia/oppia/pulls/comments/122593135","pull_request_review_id":44723402,"id":122593135,"diff_hunk":"@@ -205,6 +293,54 @@ def _reload_collection(self, collection_id):\n             raise Exception('Cannot reload a collection in production.')\n \n \n+class AdminRoleHandler(base.BaseHandler):\n+    \"\"\"Handler for roles tab of admin page. Used to view and update roles.\"\"\"\n+\n+    @require_super_admin\n+    def get(self):\n+        view_method = self.request.params['method']\n+\n+        if view_method == 'role':\n+            role = self.request.params['role']\n+            users_by_role = {\n+                username: role\n+                for username in user_services.get_usernames_by_role(role)\n+            }\n+            role_services.store_role_query(\n+                self.user_id, feconf.VIEW_ROLE, method='role', role=role)\n+            self.render_json(users_by_role)\n+        elif view_method == 'username':\n+            username = self.request.params['username']\n+            userid = user_services.get_user_id_from_username(username)\n+            role_services.store_role_query(\n+                self.user_id, feconf.VIEW_ROLE, method='username',\n+                username=username)\n+            if userid is None:\n+                self.render_json({})\n+            else:\n+                user_role_dict = {\n+                    username: user_services.get_user_role_from_id(userid)\n+                }\n+                self.render_json(user_role_dict)\n+        else:\n+            self.render_json({'error': 'Invalid method to view'})","path":"core/controllers/admin.py","position":168,"original_position":168,"commit_id":"85c59581f2043bd652d4dc841415ff5c657fe7bd","original_commit_id":"85c59581f2043bd652d4dc841415ff5c657fe7bd","user":{"login":"1995YogeshSharma","id":9693472,"avatar_url":"https://avatars1.githubusercontent.com/u/9693472?v=3","gravatar_id":"","url":"https://api.github.com/users/1995YogeshSharma","html_url":"https://github.com/1995YogeshSharma","followers_url":"https://api.github.com/users/1995YogeshSharma/followers","following_url":"https://api.github.com/users/1995YogeshSharma/following{/other_user}","gists_url":"https://api.github.com/users/1995YogeshSharma/gists{/gist_id}","starred_url":"https://api.github.com/users/1995YogeshSharma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1995YogeshSharma/subscriptions","organizations_url":"https://api.github.com/users/1995YogeshSharma/orgs","repos_url":"https://api.github.com/users/1995YogeshSharma/repos","events_url":"https://api.github.com/users/1995YogeshSharma/events{/privacy}","received_events_url":"https://api.github.com/users/1995YogeshSharma/received_events","type":"User","site_admin":false},"body":"ok. updated.","created_at":"2017-06-18T15:03:23Z","updated_at":"2017-06-18T15:03:23Z","html_url":"https://github.com/oppia/oppia/pull/3517#discussion_r122593135","pull_request_url":"https://api.github.com/repos/oppia/oppia/pulls/3517","_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments/122593135"},"html":{"href":"https://github.com/oppia/oppia/pull/3517#discussion_r122593135"},"pull_request":{"href":"https://api.github.com/repos/oppia/oppia/pulls/3517"}}},"pull_request":{"url":"https://api.github.com/repos/oppia/oppia/pulls/3517","id":124388972,"html_url":"https://github.com/oppia/oppia/pull/3517","diff_url":"https://github.com/oppia/oppia/pull/3517.diff","patch_url":"https://github.com/oppia/oppia/pull/3517.patch","issue_url":"https://api.github.com/repos/oppia/oppia/issues/3517","number":3517,"state":"open","locked":false,"title":"SiteWide ACL: Milestone 1.2","user":{"login":"1995YogeshSharma","id":9693472,"avatar_url":"https://avatars1.githubusercontent.com/u/9693472?v=3","gravatar_id":"","url":"https://api.github.com/users/1995YogeshSharma","html_url":"https://github.com/1995YogeshSharma","followers_url":"https://api.github.com/users/1995YogeshSharma/followers","following_url":"https://api.github.com/users/1995YogeshSharma/following{/other_user}","gists_url":"https://api.github.com/users/1995YogeshSharma/gists{/gist_id}","starred_url":"https://api.github.com/users/1995YogeshSharma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1995YogeshSharma/subscriptions","organizations_url":"https://api.github.com/users/1995YogeshSharma/orgs","repos_url":"https://api.github.com/users/1995YogeshSharma/repos","events_url":"https://api.github.com/users/1995YogeshSharma/events{/privacy}","received_events_url":"https://api.github.com/users/1995YogeshSharma/received_events","type":"User","site_admin":false},"body":"This PR implements the functionalities exposed to admin interface in new authorization system.\r\n\r\nlink to design doc: [Admin Ui and controller](https://docs.google.com/document/d/19Na2H3x12u4z7uXflJwRtDHclv0MfKiT2EbiWqExw1Q/edit?usp=sharing)\r\n\r\nAny changes made on roles from config tab will be reflected in the roles field so that both system remain in sync.\r\nBut changes made in roles tab are not reflected on lists in config domain, so I have added a constant in Admin.js to stop showing the update role card.","created_at":"2017-06-07T10:41:52Z","updated_at":"2017-06-18T15:03:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"645ff8cd61535152cebe97e6cbaed6e54f768786","assignee":{"login":"wxyxinyu","id":5061134,"avatar_url":"https://avatars0.githubusercontent.com/u/5061134?v=3","gravatar_id":"","url":"https://api.github.com/users/wxyxinyu","html_url":"https://github.com/wxyxinyu","followers_url":"https://api.github.com/users/wxyxinyu/followers","following_url":"https://api.github.com/users/wxyxinyu/following{/other_user}","gists_url":"https://api.github.com/users/wxyxinyu/gists{/gist_id}","starred_url":"https://api.github.com/users/wxyxinyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wxyxinyu/subscriptions","organizations_url":"https://api.github.com/users/wxyxinyu/orgs","repos_url":"https://api.github.com/users/wxyxinyu/repos","events_url":"https://api.github.com/users/wxyxinyu/events{/privacy}","received_events_url":"https://api.github.com/users/wxyxinyu/received_events","type":"User","site_admin":false},"assignees":[{"login":"wxyxinyu","id":5061134,"avatar_url":"https://avatars0.githubusercontent.com/u/5061134?v=3","gravatar_id":"","url":"https://api.github.com/users/wxyxinyu","html_url":"https://github.com/wxyxinyu","followers_url":"https://api.github.com/users/wxyxinyu/followers","following_url":"https://api.github.com/users/wxyxinyu/following{/other_user}","gists_url":"https://api.github.com/users/wxyxinyu/gists{/gist_id}","starred_url":"https://api.github.com/users/wxyxinyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wxyxinyu/subscriptions","organizations_url":"https://api.github.com/users/wxyxinyu/orgs","repos_url":"https://api.github.com/users/wxyxinyu/repos","events_url":"https://api.github.com/users/wxyxinyu/events{/privacy}","received_events_url":"https://api.github.com/users/wxyxinyu/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/oppia/oppia/pulls/3517/commits","review_comments_url":"https://api.github.com/repos/oppia/oppia/pulls/3517/comments","review_comment_url":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oppia/oppia/issues/3517/comments","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/85c59581f2043bd652d4dc841415ff5c657fe7bd","head":{"label":"1995YogeshSharma:milestone-1.2","ref":"milestone-1.2","sha":"85c59581f2043bd652d4dc841415ff5c657fe7bd","user":{"login":"1995YogeshSharma","id":9693472,"avatar_url":"https://avatars1.githubusercontent.com/u/9693472?v=3","gravatar_id":"","url":"https://api.github.com/users/1995YogeshSharma","html_url":"https://github.com/1995YogeshSharma","followers_url":"https://api.github.com/users/1995YogeshSharma/followers","following_url":"https://api.github.com/users/1995YogeshSharma/following{/other_user}","gists_url":"https://api.github.com/users/1995YogeshSharma/gists{/gist_id}","starred_url":"https://api.github.com/users/1995YogeshSharma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1995YogeshSharma/subscriptions","organizations_url":"https://api.github.com/users/1995YogeshSharma/orgs","repos_url":"https://api.github.com/users/1995YogeshSharma/repos","events_url":"https://api.github.com/users/1995YogeshSharma/events{/privacy}","received_events_url":"https://api.github.com/users/1995YogeshSharma/received_events","type":"User","site_admin":false},"repo":{"id":81466647,"name":"oppia","full_name":"1995YogeshSharma/oppia","owner":{"login":"1995YogeshSharma","id":9693472,"avatar_url":"https://avatars1.githubusercontent.com/u/9693472?v=3","gravatar_id":"","url":"https://api.github.com/users/1995YogeshSharma","html_url":"https://github.com/1995YogeshSharma","followers_url":"https://api.github.com/users/1995YogeshSharma/followers","following_url":"https://api.github.com/users/1995YogeshSharma/following{/other_user}","gists_url":"https://api.github.com/users/1995YogeshSharma/gists{/gist_id}","starred_url":"https://api.github.com/users/1995YogeshSharma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1995YogeshSharma/subscriptions","organizations_url":"https://api.github.com/users/1995YogeshSharma/orgs","repos_url":"https://api.github.com/users/1995YogeshSharma/repos","events_url":"https://api.github.com/users/1995YogeshSharma/events{/privacy}","received_events_url":"https://api.github.com/users/1995YogeshSharma/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/1995YogeshSharma/oppia","description":"Tool for collaboratively building interactive lessons.","fork":true,"url":"https://api.github.com/repos/1995YogeshSharma/oppia","forks_url":"https://api.github.com/repos/1995YogeshSharma/oppia/forks","keys_url":"https://api.github.com/repos/1995YogeshSharma/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/1995YogeshSharma/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/1995YogeshSharma/oppia/teams","hooks_url":"https://api.github.com/repos/1995YogeshSharma/oppia/hooks","issue_events_url":"https://api.github.com/repos/1995YogeshSharma/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/1995YogeshSharma/oppia/events","assignees_url":"https://api.github.com/repos/1995YogeshSharma/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/1995YogeshSharma/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/1995YogeshSharma/oppia/tags","blobs_url":"https://api.github.com/repos/1995YogeshSharma/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/1995YogeshSharma/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/1995YogeshSharma/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/1995YogeshSharma/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/1995YogeshSharma/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/1995YogeshSharma/oppia/languages","stargazers_url":"https://api.github.com/repos/1995YogeshSharma/oppia/stargazers","contributors_url":"https://api.github.com/repos/1995YogeshSharma/oppia/contributors","subscribers_url":"https://api.github.com/repos/1995YogeshSharma/oppia/subscribers","subscription_url":"https://api.github.com/repos/1995YogeshSharma/oppia/subscription","commits_url":"https://api.github.com/repos/1995YogeshSharma/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/1995YogeshSharma/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/1995YogeshSharma/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/1995YogeshSharma/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/1995YogeshSharma/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/1995YogeshSharma/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/1995YogeshSharma/oppia/merges","archive_url":"https://api.github.com/repos/1995YogeshSharma/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/1995YogeshSharma/oppia/downloads","issues_url":"https://api.github.com/repos/1995YogeshSharma/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/1995YogeshSharma/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/1995YogeshSharma/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/1995YogeshSharma/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/1995YogeshSharma/oppia/labels{/name}","releases_url":"https://api.github.com/repos/1995YogeshSharma/oppia/releases{/id}","deployments_url":"https://api.github.com/repos/1995YogeshSharma/oppia/deployments","created_at":"2017-02-09T15:50:27Z","updated_at":"2017-02-09T15:50:32Z","pushed_at":"2017-06-17T18:09:04Z","git_url":"git://github.com/1995YogeshSharma/oppia.git","ssh_url":"git@github.com:1995YogeshSharma/oppia.git","clone_url":"https://github.com/1995YogeshSharma/oppia.git","svn_url":"https://github.com/1995YogeshSharma/oppia","homepage":"https://www.oppia.org","size":52168,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":false,"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":"develop"}},"base":{"label":"oppia:develop","ref":"develop","sha":"ae70fc1447cc8c2380e585f13e5c61fcc38232af","user":{"login":"oppia","id":11620230,"avatar_url":"https://avatars2.githubusercontent.com/u/11620230?v=3","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"repo":{"id":40687563,"name":"oppia","full_name":"oppia/oppia","owner":{"login":"oppia","id":11620230,"avatar_url":"https://avatars2.githubusercontent.com/u/11620230?v=3","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oppia/oppia","description":"Tool for collaboratively building interactive lessons.","fork":false,"url":"https://api.github.com/repos/oppia/oppia","forks_url":"https://api.github.com/repos/oppia/oppia/forks","keys_url":"https://api.github.com/repos/oppia/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oppia/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oppia/oppia/teams","hooks_url":"https://api.github.com/repos/oppia/oppia/hooks","issue_events_url":"https://api.github.com/repos/oppia/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/oppia/oppia/events","assignees_url":"https://api.github.com/repos/oppia/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/oppia/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/oppia/oppia/tags","blobs_url":"https://api.github.com/repos/oppia/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oppia/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oppia/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/oppia/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/oppia/oppia/languages","stargazers_url":"https://api.github.com/repos/oppia/oppia/stargazers","contributors_url":"https://api.github.com/repos/oppia/oppia/contributors","subscribers_url":"https://api.github.com/repos/oppia/oppia/subscribers","subscription_url":"https://api.github.com/repos/oppia/oppia/subscription","commits_url":"https://api.github.com/repos/oppia/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/oppia/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/oppia/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/oppia/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/oppia/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/oppia/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oppia/oppia/merges","archive_url":"https://api.github.com/repos/oppia/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oppia/oppia/downloads","issues_url":"https://api.github.com/repos/oppia/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/oppia/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/oppia/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/oppia/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oppia/oppia/labels{/name}","releases_url":"https://api.github.com/repos/oppia/oppia/releases{/id}","deployments_url":"https://api.github.com/repos/oppia/oppia/deployments","created_at":"2015-08-14T00:16:14Z","updated_at":"2017-06-18T15:02:28Z","pushed_at":"2017-06-18T14:28:24Z","git_url":"git://github.com/oppia/oppia.git","ssh_url":"git@github.com:oppia/oppia.git","clone_url":"https://github.com/oppia/oppia.git","svn_url":"https://github.com/oppia/oppia","homepage":"https://www.oppia.org","size":52376,"stargazers_count":320,"watchers_count":320,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":433,"mirror_url":null,"open_issues_count":352,"forks":433,"open_issues":352,"watchers":320,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/3517"},"html":{"href":"https://github.com/oppia/oppia/pull/3517"},"issue":{"href":"https://api.github.com/repos/oppia/oppia/issues/3517"},"comments":{"href":"https://api.github.com/repos/oppia/oppia/issues/3517/comments"},"review_comments":{"href":"https://api.github.com/repos/oppia/oppia/pulls/3517/comments"},"review_comment":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oppia/oppia/pulls/3517/commits"},"statuses":{"href":"https://api.github.com/repos/oppia/oppia/statuses/85c59581f2043bd652d4dc841415ff5c657fe7bd"}}}}
{"actor":{"display_login":"1995YogeshSharma"}}