{"action":"created","issue":{"url":"https://api.github.com/repos/edx/edx-platform/issues/8995","labels_url":"https://api.github.com/repos/edx/edx-platform/issues/8995/labels{/name}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/8995/comments","events_url":"https://api.github.com/repos/edx/edx-platform/issues/8995/events","html_url":"https://github.com/edx/edx-platform/pull/8995","id":96443821,"number":8995,"title":"Allow previewing cohorted content when masquerading (SOL-1064)","user":{"login":"bradenmacdonald","id":945577,"avatar_url":"https://avatars.githubusercontent.com/u/945577?v=3","gravatar_id":"","url":"https://api.github.com/users/bradenmacdonald","html_url":"https://github.com/bradenmacdonald","followers_url":"https://api.github.com/users/bradenmacdonald/followers","following_url":"https://api.github.com/users/bradenmacdonald/following{/other_user}","gists_url":"https://api.github.com/users/bradenmacdonald/gists{/gist_id}","starred_url":"https://api.github.com/users/bradenmacdonald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradenmacdonald/subscriptions","organizations_url":"https://api.github.com/users/bradenmacdonald/orgs","repos_url":"https://api.github.com/users/bradenmacdonald/repos","events_url":"https://api.github.com/users/bradenmacdonald/events{/privacy}","received_events_url":"https://api.github.com/users/bradenmacdonald/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-22T00:08:55Z","updated_at":"2015-07-23T05:44:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/8995","html_url":"https://github.com/edx/edx-platform/pull/8995","diff_url":"https://github.com/edx/edx-platform/pull/8995.diff","patch_url":"https://github.com/edx/edx-platform/pull/8995.patch"},"body":"**JIRA**: [SOL-1064](https://openedx.atlassian.net/browse/SOL-1064)\r\n\r\n**Description**: This is a follow-up to #8775, in order to allow masquerading as a specific user to work with cohorted course content.\r\n\r\nMasquerade Type | Behavior Before | Behavior Now\r\n-------------------------|-----------------------|--------------------\r\nNone (\"Staff\")        | Shows content of all cohorts | Unchanged\r\n\"Student\"               | Hides any cohort-specific content | Unchanged\r\n\"Specific Student\" | Hides any cohort-specific content | Shows the specific cohorted content that the student would see\r\n\"Student in Content Group x\" | Shows only cohort-specific content from the specific content group | Unchanged\r\n\r\nThe main fix was to modify `CohortPartitionScheme.get_group_for_user` to be more explicit about masquerading behavior and what group it will return when masquerading is active.\r\n\r\nA part of the issue was that the existing code would set the `user_partition_id` property during every type of masquerade, and only set the `group_id` property when masquerading as a generic user in a specific content group. When `get_group_for_user()` called `courseware.masquerade.get_masquerading_group_info()`, it would return a `user_partition_id` but not a `group_id`. This caused `get_group_for_user` to short-circuit its normal method for determining which group a user belongs to, instead simply returning `None`.\r\n\r\n**Merge Deadline**: Need to get this in before the weekly release is cut on Friday July 24\r\n\r\n**Sandbox**: http://sandbox6.opencraft.com/courses/course-v1:MasqueradeX+M+15/courseware/9bd39a386c624e0cbc78385734ef13f2/8834fceec55f478381885f24e00fdc8a/\r\n\r\n**Test Instructions**: On the sandbox, login as \"staff\" and preview the course as \"honor\" or \"verified\". Each student should be in a different content group.\r\n\r\n**Notes**: If a student has not yet used the courseware and so has not been assigned to a cohort, then previewing the course as that student may assign the student to a cohort randomly (as would normally happen when the student visits the courseware). I don't think that's a problem."},"comment":{"url":"https://api.github.com/repos/edx/edx-platform/issues/comments/123979249","html_url":"https://github.com/edx/edx-platform/pull/8995#issuecomment-123979249","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/8995","id":123979249,"user":{"login":"antoviaque","id":514483,"avatar_url":"https://avatars.githubusercontent.com/u/514483?v=3","gravatar_id":"","url":"https://api.github.com/users/antoviaque","html_url":"https://github.com/antoviaque","followers_url":"https://api.github.com/users/antoviaque/followers","following_url":"https://api.github.com/users/antoviaque/following{/other_user}","gists_url":"https://api.github.com/users/antoviaque/gists{/gist_id}","starred_url":"https://api.github.com/users/antoviaque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoviaque/subscriptions","organizations_url":"https://api.github.com/users/antoviaque/orgs","repos_url":"https://api.github.com/users/antoviaque/repos","events_url":"https://api.github.com/users/antoviaque/events{/privacy}","received_events_url":"https://api.github.com/users/antoviaque/received_events","type":"User","site_admin":false},"created_at":"2015-07-23T05:44:51Z","updated_at":"2015-07-23T05:44:51Z","body":"@pbaruah @catong Ping for product & doc reviews - don't hesitate if you have questions about the change.\r\n\r\nCC @griffresch "}}