Conversation
No permissions are granted for CCX courses, this is just a placeholder to keep these courses from erroring until we get to the LMS side
|
Test results
Tests with both RBAC and CCX enabled:
✳️ I had difficulties after running the migrate w/delete command and was forcibly logged out. Once I logged back in things worked as expected. |
NotesThese issues are unrelated to RBAC. CCX courses have the instructor dash, but...
The instructor dash MFE conversion team have been made aware of these issues. |
Previously if there were any errors, success messages were eaten. Added message to state why no roles may have been migrated (already migrated, bad ids)
6cf67cb to
4b7f6ff
Compare
rodmgwgu
left a comment
There was a problem hiding this comment.
Thanks for looking into this!, code looks good, just one small comment correction and please update the changelog and version.
There was a problem hiding this comment.
Approving — clean approach, just a few typos below.
Review assisted by Kiro.
openedx_authz/management/commands/authz_migrate_course_authoring.py
Outdated
Show resolved
Hide resolved
openedx_authz/management/commands/authz_rollback_course_authoring.py
Outdated
Show resolved
Hide resolved
openedx_authz/management/commands/authz_rollback_course_authoring.py
Outdated
Show resolved
Hide resolved
mariajgrimaldi
left a comment
There was a problem hiding this comment.
I'll deploy this on our sandbox environment! Thanks a lot
| # This is a known LMS-only permission, but doesn't actually grant anything yet. | ||
| # | ||
| # It is intended to be handled in the Willow time frame. | ||
| CCX_COACH_PERMISSIONS = [] |
There was a problem hiding this comment.
Permissions should be specified here I belive: https://github.com/openedx/openedx-authz/blob/main/openedx_authz/constants/permissions.py
There was a problem hiding this comment.
I think that's where we would define the permissions that we would include here, however we aren't migrating any of the CCX permissions right now, they are all in LMS / instructor dash, so this just creates an empty permission set so that we can define the role.
|
@mariajgrimaldi @bmtcril did you test this in sandbox? would you be ok with merging this? |
|
I haven't been able to get into the sandbox to test, @mariajgrimaldi is it down? |
This PR attempts to address the issues detailed in #235 . There are 4 overlapping sets of problems:
--deletecould cause the CCX course to be left in a state where there was no CCX Coach to run the course and rollback would not re-grant the roleThis PR addresses 1 and 2 by adding a
CCXCourseOverviewDataclass andCCX_COACHthat grant no permissions, but satisfy the checks for existence. This also allows theccx_coachrole to be migrated / rolled back without error.It addresses 3 by not allowing CCX courses to be migrated / rolled back using the migration scripts, and by better surfacing those errors.
It does not address 4 as that should happen as part of openedx/openedx-platform#38145 , but in that task it should throw an error if trying to turn on the RBAC flag for any non-course-v1 course until we are ready to support them.
It does not address other non-course-v1 locators. To the best of our (myself, Dave Ormsbee, Kyle McCormick) only know of one other possible case like this- Old Mongo keys. These are largely unsupported (do not work at all in Studio or Courseware, may not even show up on the student dashboard) and, as near as anyone can tell, un-testable.
If this approach looks good I will complete the rest of the merge checklist and update 38145 with details. This branch is tested in openedx-platform here.
Notes on CCX roles and permissions
staffrole on the CCX course as well.instructorandstaffon the CCX courseTesting
I do not expect anyone to do this, but here is what I did.
Setup
CUSTOM_COURSES_EDX: trueto the Tutor patch "common-env-features")a. Create through the normal UI
b. Log into studio as the user (will probably error, but creates a needed row in the database)
c. As superuser go to http://studio.local.openedx.io/admin/course_creators/coursecreator/
i. Your new user should show up in the list, mark them as "granted"
ii. Using "All Organizations" didn't work for me, courses wouldn't create, I had to add specific orgs to the user. You may have to create one first by creating a course as a superuser.
d. As superuser go to http://studio.local.openedx.io/admin/auth/user/
i. Click on your new user and mark them as "active" in the Permissions section, then save. !! There is an "is_active" flag under account recovery, that is the wrong one.
a. Create through the normal UI
b. Mark "active" in the Django admin as above
Test
All tests should complete without error.
a. Add some content / change course start date to a date in the past / publish
b. View in LMS
c. Get into correct configuration
If CCX:
i. As course creator: Studio -> Advanced Settings -> set CCX enabled
trueii. As course creator: Add the coach user to the course - LMS -> Instructor dashboard -> Membership -> Course Team Management -> CCX Coaches role, enter the coach username, add
iii. As coach: LMS -> CCX Coach -> CCX Coach Dashboard -> Enter name, create
iv. Due to an unrelated bug you must force publish the CCX course here before it will work: http://studio.local.openedx.io/admin/contentstore/courseoutlineregenerate/ (check the course box, from the "actions" box select "Regenerate selected course outlines", click "go")
v. Click through all of the CCX Coach Dashboard options, try everything
If RBAC:
i. Turn on the course override waffle flag for the parent and/or CCX course: http://studio.local.openedx.io/admin/waffle_utils/waffleflagcourseoverridemodel/
a. Add / change content
b. Publish
c. View in LMS, content should be up to date
Merge checklist:
Check off if complete or not applicable: