{"action":"created","issue":{"url":"https://api.github.com/repos/edx/edx-platform/issues/14153","repository_url":"https://api.github.com/repos/edx/edx-platform","labels_url":"https://api.github.com/repos/edx/edx-platform/issues/14153/labels{/name}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/14153/comments","events_url":"https://api.github.com/repos/edx/edx-platform/issues/14153/events","html_url":"https://github.com/edx/edx-platform/pull/14153","id":195742838,"number":14153,"title":"Checks access using the CCX course key instead of the base course key","user":{"login":"pomegranited","id":7556571,"avatar_url":"https://avatars.githubusercontent.com/u/7556571?v=3","gravatar_id":"","url":"https://api.github.com/users/pomegranited","html_url":"https://github.com/pomegranited","followers_url":"https://api.github.com/users/pomegranited/followers","following_url":"https://api.github.com/users/pomegranited/following{/other_user}","gists_url":"https://api.github.com/users/pomegranited/gists{/gist_id}","starred_url":"https://api.github.com/users/pomegranited/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pomegranited/subscriptions","organizations_url":"https://api.github.com/users/pomegranited/orgs","repos_url":"https://api.github.com/users/pomegranited/repos","events_url":"https://api.github.com/users/pomegranited/events{/privacy}","received_events_url":"https://api.github.com/users/pomegranited/received_events","type":"User","site_admin":false},"labels":[{"id":78051711,"url":"https://api.github.com/repos/edx/edx-platform/labels/open-source-contribution","name":"open-source-contribution","color":"bfe5bf","default":false},{"id":128413103,"url":"https://api.github.com/repos/edx/edx-platform/labels/product%20review","name":"product review","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":25,"created_at":"2016-12-15T08:17:36Z","updated_at":"2016-12-22T16:31:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/14153","html_url":"https://github.com/edx/edx-platform/pull/14153","diff_url":"https://github.com/edx/edx-platform/pull/14153.diff","patch_url":"https://github.com/edx/edx-platform/pull/14153.patch"},"body":"Currently, when a CCX Coach, or another user with a Staff role on a CCX course, tries to access Insights, they're unable to see their CCX courses in the list of available courses.  In the extreme case, users who only have Staff roles on CCX courses get a 403 when they visit Insights, because they have no staff permissions on any courses.\r\n\r\nThis change amends the CCX course permissions check to use the actual CCX course key, instead of the base course locator key, which does not contain the CCX details.\r\n\r\n**JIRA tickets**: [OSPR-1623](https://openedx.atlassian.net/browse/OSPR-1623)\r\n\r\n**Dependencies**: None\r\n\r\n**Sandbox URL**:\r\n\r\n* LMS: http://pr14104.sandbox.opencraft.hosting/\r\n\r\n**Partner information**: DavidsonX, on edx.org\r\n\r\n**Deployment targets**: edx.org and edge.edx.org\r\n\r\n**Merge deadline**: ASAP\r\n\r\n**Testing instructions**:\r\n\r\n1. Set up an [analytics devstack](http://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/installation/analytics/install_analytics.html).\r\n1. Enable the [`enable_ccx_courses` waffle switch](https://github.com/edx/edx-analytics-dashboard#feature-gating) on Insights.\r\n1. Checkout the PR for this branch under edx-platform.\r\n1. Run the [LMS and Insights services](http://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/installation/devstack/start_devstack.html#starting-the-components).\r\n1. Register and activate a new user: `ccx_coach`. This user should not have global staff or global superuser settings.\r\n1. As the `staff` user in LMS (w global staff settings):\r\n    * Enable CCX on a course via the Advanced Settings (the DemoX course should be enabled by default.)\r\n    * Give `ccx_coach` a Staff role on the base course via the LMS Instructor panel.\r\n    * Let the `ccx_coach` create the CCX course as described below.\r\n1. As the staff user in Insights:\r\n    * Logout and in again, if there's a previously active Insights session.  This refreshes the course access cache.\r\n    * Verify that the base Demo course and the CCX courses are shown on the home page list.\r\n    * Verify that the base Demo course and CCX course pages work.\r\n1. As the `ccx_coach` user in LMS:\r\n    * Create a CCX course from the base course, e.g.: `ccx-v1:edX+DemoX+Demo_Course+ccx@1`\r\n    * Enrol the `audit` user as a student on the CCX course, via the CCX Coach panel.\r\n1. As the `ccx_coach` user in Insights:\r\n    * Logout and in again.\r\n    * Verify that the /courses home page shows the CCX course in the list.\r\n    * Verify that the CCX course page displays correctly.\r\n1. As the `audit` user in Insights (w Student role):\r\n    * Logout and in again.\r\n    * Verify that the /courses home page shows a 403 (or at least, that it doesn't show the CCX course in the list).\r\n1. As the `staff` user in LMS (w global staff settings):\r\n    * Visit the CCX course's Instructor > Membership page\r\n    * Give the `audit` a Staff role.\r\n1. As the `audit` user in Insights (w Staff role):\r\n    * Logout and in again.\r\n    * Verify that the /courses home page shows the CCX course in the list.\r\n    * Verify that the CCX course page displays correctly.\r\n\r\n**Author notes and concerns**:\r\n\r\n1. Updated unit tests are coming.\r\n\r\n**Reviewers**\r\n- [x] @bdero \r\n- [ ] edX reviewer[s] TBD"},"comment":{"url":"https://api.github.com/repos/edx/edx-platform/issues/comments/268836573","html_url":"https://github.com/edx/edx-platform/pull/14153#issuecomment-268836573","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/14153","id":268836573,"user":{"login":"ormsbee","id":41625,"avatar_url":"https://avatars.githubusercontent.com/u/41625?v=3","gravatar_id":"","url":"https://api.github.com/users/ormsbee","html_url":"https://github.com/ormsbee","followers_url":"https://api.github.com/users/ormsbee/followers","following_url":"https://api.github.com/users/ormsbee/following{/other_user}","gists_url":"https://api.github.com/users/ormsbee/gists{/gist_id}","starred_url":"https://api.github.com/users/ormsbee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ormsbee/subscriptions","organizations_url":"https://api.github.com/users/ormsbee/orgs","repos_url":"https://api.github.com/users/ormsbee/repos","events_url":"https://api.github.com/users/ormsbee/events{/privacy}","received_events_url":"https://api.github.com/users/ormsbee/received_events","type":"User","site_admin":false},"created_at":"2016-12-22T16:31:10Z","updated_at":"2016-12-22T16:31:10Z","body":"We have been doing daily releases with the new build pipeline this week, but today's release has already been cut, and we are not currently planning to do any releases next week (it's the holidays -- we've got a skeleton crew). So unless this rises to the level of a hotfix, it won't be on prod until the following week."}}
{"actor":{"display_login":"ormsbee"}}