{"action":"created","comment":{"url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/comments/56651019","id":56651019,"diff_hunk":"@@ -79,46 +82,46 @@ def lti_launch(request):\n \n \n @login_required\n-@has_account_permission(canvas_api_accounts.ACCOUNT_PERMISSION_MANAGE_COURSES)\n+@lti_permission_required(canvas_api_accounts.ACCOUNT_PERMISSION_MANAGE_COURSES)\n @require_http_methods(['GET'])\n def index(request):\n-    canvas_user_id = request.LTI['custom_canvas_user_id']\n     sis_account_id = request.LTI['custom_canvas_account_sis_id']\n-    ci_filters = {key: request.GET.get(key, '') for key in COURSE_INSTANCE_FILTERS}\n+    ci_filters = {key: request.GET.get(key, '')\n+                  for key in COURSE_INSTANCE_FILTERS}\n     (account_type, _) = canvas_api_accounts.parse_canvas_account_id(sis_account_id)\n     schools = []\n     terms = []\n     departments = []\n     course_groups = []\n     school = None\n+    if account_type:\n+        if account_type in canvas_api_accounts.ACCOUNT_TYPES:\n+\n+            # If user is in context Department or Course Group, display a\n+            # message conveying restricted access\n+            if (account_type == canvas_api_accounts.ACCOUNT_TYPE_DEPARTMENT or\n+                account_type == canvas_api_accounts.ACCOUNT_TYPE_COURSE_GROUP):\n+                return render(request, 'bulk_site_creation/restricted_access.html')","path":"bulk_site_creation/views.py","position":61,"original_position":61,"commit_id":"64093b7a5254aafdb0902fdcb2d790ed9badbb64","original_commit_id":"64093b7a5254aafdb0902fdcb2d790ed9badbb64","user":{"login":"rascalking","id":707505,"avatar_url":"https://avatars.githubusercontent.com/u/707505?v=3","gravatar_id":"","url":"https://api.github.com/users/rascalking","html_url":"https://github.com/rascalking","followers_url":"https://api.github.com/users/rascalking/followers","following_url":"https://api.github.com/users/rascalking/following{/other_user}","gists_url":"https://api.github.com/users/rascalking/gists{/gist_id}","starred_url":"https://api.github.com/users/rascalking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rascalking/subscriptions","organizations_url":"https://api.github.com/users/rascalking/orgs","repos_url":"https://api.github.com/users/rascalking/repos","events_url":"https://api.github.com/users/rascalking/events{/privacy}","received_events_url":"https://api.github.com/users/rascalking/received_events","type":"User","site_admin":false},"body":"I think this probably wants to return a 403, not the default 200.","created_at":"2016-03-18T12:53:45Z","updated_at":"2016-03-18T12:53:45Z","html_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools/pull/446#discussion_r56651019","pull_request_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/446","_links":{"self":{"href":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/comments/56651019"},"html":{"href":"https://github.com/Harvard-University-iCommons/icommons_lti_tools/pull/446#discussion_r56651019"},"pull_request":{"href":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/446"}}},"pull_request":{"url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/446","id":63274446,"html_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools/pull/446","diff_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools/pull/446.diff","patch_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools/pull/446.patch","issue_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues/446","number":446,"state":"open","locked":false,"title":"Task/eparker71/tlt 2193 add lti permissions to bulk site creator","user":{"login":"sapnamysore","id":1084105,"avatar_url":"https://avatars.githubusercontent.com/u/1084105?v=3","gravatar_id":"","url":"https://api.github.com/users/sapnamysore","html_url":"https://github.com/sapnamysore","followers_url":"https://api.github.com/users/sapnamysore/followers","following_url":"https://api.github.com/users/sapnamysore/following{/other_user}","gists_url":"https://api.github.com/users/sapnamysore/gists{/gist_id}","starred_url":"https://api.github.com/users/sapnamysore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sapnamysore/subscriptions","organizations_url":"https://api.github.com/users/sapnamysore/orgs","repos_url":"https://api.github.com/users/sapnamysore/repos","events_url":"https://api.github.com/users/sapnamysore/events{/privacy}","received_events_url":"https://api.github.com/users/sapnamysore/received_events","type":"User","site_admin":false},"body":"This PR has changes for https://jira.huit.harvard.edu/browse/TLT-2469\r\n\r\nA lot of the logic for AC1 for  2469 was resurrected from [TLT-2193](https://jira.huit.harvard.edu/browse/TLT-2193). The PR for 2193 was done and had been moved to ACP, but it was backed out due to some release schedule.  Original PR is here https://github.com/Harvard-University-iCommons/icommons_lti_tools/pull/383\r\n\r\nAdded a simple restricted message page for AC2 and ran got it OKed by PO. Added some unit tests for AC2.","created_at":"2016-03-17T18:55:02Z","updated_at":"2016-03-18T12:53:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03f1b867c3bc601f70705ecb181b6570aa273add","assignee":{"login":"rascalking","id":707505,"avatar_url":"https://avatars.githubusercontent.com/u/707505?v=3","gravatar_id":"","url":"https://api.github.com/users/rascalking","html_url":"https://github.com/rascalking","followers_url":"https://api.github.com/users/rascalking/followers","following_url":"https://api.github.com/users/rascalking/following{/other_user}","gists_url":"https://api.github.com/users/rascalking/gists{/gist_id}","starred_url":"https://api.github.com/users/rascalking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rascalking/subscriptions","organizations_url":"https://api.github.com/users/rascalking/orgs","repos_url":"https://api.github.com/users/rascalking/repos","events_url":"https://api.github.com/users/rascalking/events{/privacy}","received_events_url":"https://api.github.com/users/rascalking/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/446/commits","review_comments_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/446/comments","review_comment_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues/446/comments","statuses_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/statuses/64093b7a5254aafdb0902fdcb2d790ed9badbb64","head":{"label":"Harvard-University-iCommons:task/eparker71/TLT-2193-add-lti-permissions-to-bulk-site-creator","ref":"task/eparker71/TLT-2193-add-lti-permissions-to-bulk-site-creator","sha":"64093b7a5254aafdb0902fdcb2d790ed9badbb64","user":{"login":"Harvard-University-iCommons","id":1083915,"avatar_url":"https://avatars.githubusercontent.com/u/1083915?v=3","gravatar_id":"","url":"https://api.github.com/users/Harvard-University-iCommons","html_url":"https://github.com/Harvard-University-iCommons","followers_url":"https://api.github.com/users/Harvard-University-iCommons/followers","following_url":"https://api.github.com/users/Harvard-University-iCommons/following{/other_user}","gists_url":"https://api.github.com/users/Harvard-University-iCommons/gists{/gist_id}","starred_url":"https://api.github.com/users/Harvard-University-iCommons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Harvard-University-iCommons/subscriptions","organizations_url":"https://api.github.com/users/Harvard-University-iCommons/orgs","repos_url":"https://api.github.com/users/Harvard-University-iCommons/repos","events_url":"https://api.github.com/users/Harvard-University-iCommons/events{/privacy}","received_events_url":"https://api.github.com/users/Harvard-University-iCommons/received_events","type":"Organization","site_admin":false},"repo":{"id":14696916,"name":"icommons_lti_tools","full_name":"Harvard-University-iCommons/icommons_lti_tools","owner":{"login":"Harvard-University-iCommons","id":1083915,"avatar_url":"https://avatars.githubusercontent.com/u/1083915?v=3","gravatar_id":"","url":"https://api.github.com/users/Harvard-University-iCommons","html_url":"https://github.com/Harvard-University-iCommons","followers_url":"https://api.github.com/users/Harvard-University-iCommons/followers","following_url":"https://api.github.com/users/Harvard-University-iCommons/following{/other_user}","gists_url":"https://api.github.com/users/Harvard-University-iCommons/gists{/gist_id}","starred_url":"https://api.github.com/users/Harvard-University-iCommons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Harvard-University-iCommons/subscriptions","organizations_url":"https://api.github.com/users/Harvard-University-iCommons/orgs","repos_url":"https://api.github.com/users/Harvard-University-iCommons/repos","events_url":"https://api.github.com/users/Harvard-University-iCommons/events{/privacy}","received_events_url":"https://api.github.com/users/Harvard-University-iCommons/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools","description":"LTI tools for Canvas","fork":false,"url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools","forks_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/forks","keys_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/teams","hooks_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/hooks","issue_events_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues/events{/number}","events_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/events","assignees_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/assignees{/user}","branches_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/branches{/branch}","tags_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/tags","blobs_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/statuses/{sha}","languages_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/languages","stargazers_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/stargazers","contributors_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/contributors","subscribers_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/subscribers","subscription_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/subscription","commits_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/contents/{+path}","compare_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/merges","archive_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/downloads","issues_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues{/number}","pulls_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls{/number}","milestones_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/milestones{/number}","notifications_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/labels{/name}","releases_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/releases{/id}","deployments_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/deployments","created_at":"2013-11-25T20:06:20Z","updated_at":"2016-03-16T15:51:55Z","pushed_at":"2016-03-17T19:15:31Z","git_url":"git://github.com/Harvard-University-iCommons/icommons_lti_tools.git","ssh_url":"git@github.com:Harvard-University-iCommons/icommons_lti_tools.git","clone_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools.git","svn_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools","homepage":"","size":4580,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":5,"default_branch":"develop"}},"base":{"label":"Harvard-University-iCommons:develop","ref":"develop","sha":"de509689aa34f1765858b55fab06a77e40a9d0a7","user":{"login":"Harvard-University-iCommons","id":1083915,"avatar_url":"https://avatars.githubusercontent.com/u/1083915?v=3","gravatar_id":"","url":"https://api.github.com/users/Harvard-University-iCommons","html_url":"https://github.com/Harvard-University-iCommons","followers_url":"https://api.github.com/users/Harvard-University-iCommons/followers","following_url":"https://api.github.com/users/Harvard-University-iCommons/following{/other_user}","gists_url":"https://api.github.com/users/Harvard-University-iCommons/gists{/gist_id}","starred_url":"https://api.github.com/users/Harvard-University-iCommons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Harvard-University-iCommons/subscriptions","organizations_url":"https://api.github.com/users/Harvard-University-iCommons/orgs","repos_url":"https://api.github.com/users/Harvard-University-iCommons/repos","events_url":"https://api.github.com/users/Harvard-University-iCommons/events{/privacy}","received_events_url":"https://api.github.com/users/Harvard-University-iCommons/received_events","type":"Organization","site_admin":false},"repo":{"id":14696916,"name":"icommons_lti_tools","full_name":"Harvard-University-iCommons/icommons_lti_tools","owner":{"login":"Harvard-University-iCommons","id":1083915,"avatar_url":"https://avatars.githubusercontent.com/u/1083915?v=3","gravatar_id":"","url":"https://api.github.com/users/Harvard-University-iCommons","html_url":"https://github.com/Harvard-University-iCommons","followers_url":"https://api.github.com/users/Harvard-University-iCommons/followers","following_url":"https://api.github.com/users/Harvard-University-iCommons/following{/other_user}","gists_url":"https://api.github.com/users/Harvard-University-iCommons/gists{/gist_id}","starred_url":"https://api.github.com/users/Harvard-University-iCommons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Harvard-University-iCommons/subscriptions","organizations_url":"https://api.github.com/users/Harvard-University-iCommons/orgs","repos_url":"https://api.github.com/users/Harvard-University-iCommons/repos","events_url":"https://api.github.com/users/Harvard-University-iCommons/events{/privacy}","received_events_url":"https://api.github.com/users/Harvard-University-iCommons/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools","description":"LTI tools for Canvas","fork":false,"url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools","forks_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/forks","keys_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/teams","hooks_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/hooks","issue_events_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues/events{/number}","events_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/events","assignees_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/assignees{/user}","branches_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/branches{/branch}","tags_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/tags","blobs_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/statuses/{sha}","languages_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/languages","stargazers_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/stargazers","contributors_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/contributors","subscribers_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/subscribers","subscription_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/subscription","commits_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/contents/{+path}","compare_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/merges","archive_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/downloads","issues_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues{/number}","pulls_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls{/number}","milestones_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/milestones{/number}","notifications_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/labels{/name}","releases_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/releases{/id}","deployments_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/deployments","created_at":"2013-11-25T20:06:20Z","updated_at":"2016-03-16T15:51:55Z","pushed_at":"2016-03-17T19:15:31Z","git_url":"git://github.com/Harvard-University-iCommons/icommons_lti_tools.git","ssh_url":"git@github.com:Harvard-University-iCommons/icommons_lti_tools.git","clone_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools.git","svn_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools","homepage":"","size":4580,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":5,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/446"},"html":{"href":"https://github.com/Harvard-University-iCommons/icommons_lti_tools/pull/446"},"issue":{"href":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues/446"},"comments":{"href":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues/446/comments"},"review_comments":{"href":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/446/comments"},"review_comment":{"href":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/446/commits"},"statuses":{"href":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/statuses/64093b7a5254aafdb0902fdcb2d790ed9badbb64"}}}}