Skip to content

Comments

fix: eSHE Instructor should be able to see forum members and enrollments [BB-7841]#585

Merged
0x29a merged 1 commit intoopencraft-release/palm.1from
0x29a/bb7841/fix-permissions
Sep 18, 2023
Merged

fix: eSHE Instructor should be able to see forum members and enrollments [BB-7841]#585
0x29a merged 1 commit intoopencraft-release/palm.1from
0x29a/bb7841/fix-permissions

Conversation

@0x29a
Copy link

@0x29a 0x29a commented Sep 14, 2023

Description

Consider this diff. We've modified CAN_ENROLL permission in a way that eSHE Instructors don't have it, but eSHE Instructor + Staff have.

However, the same permission is used to control two other endpoints that shouldn't be forbidden to eSHE Instructor. One of them, get_student_enrollment_status, is used for this instructor view:
image

So this PR fixes these two endpoints for eSHE Instructors by introducing two new permissions, specific to these endpoints, with the same access level as before.

Testing instructions

  1. Switch your devstack to the 0x29a/bb7841/fix-permissions branch from the git@github.com:open-craft/edx-platform.git repo.
  2. Enable the eSHE Instructor role by setting this to True.
  3. Open two browser tabs, one of them should be anonymous.
  4. In one tab log in as staff, in the other register as eshe_instructor@example.com.
  5. As a staff, give eshe_instructor@example.com the eSHE Instructor course team role (that can be done in the Instructor Dashboard).
  6. Now, verify that eshe_instructor@example.com can view enrollment status of staff@example.com.

@0x29a 0x29a force-pushed the 0x29a/bb7841/fix-permissions branch from d27b3f4 to 2be436d Compare September 14, 2023 13:16
Copy link
Member

@viadanna viadanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

  • I tested this
  • I read through the code

@ensure_csrf_cookie
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
@require_course_permission(permissions.CAN_ENROLL)
@require_course_permission(permissions.VIEW_ENROLLMENTS)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes much more sense than having it require the CAN_ENROLL 👍

@0x29a 0x29a merged commit d5e16f5 into opencraft-release/palm.1 Sep 18, 2023
@0x29a 0x29a deleted the 0x29a/bb7841/fix-permissions branch September 18, 2023 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants