Skip to content

fix: preserve catalog and staff checks for authZ about-page access - #38736

Merged
MaferMazu merged 2 commits into
openedx:masterfrom
eduNEXT:bav/fix-can-see-about-page-with-authz
Jun 22, 2026
Merged

fix: preserve catalog and staff checks for authZ about-page access#38736
MaferMazu merged 2 commits into
openedx:masterfrom
eduNEXT:bav/fix-can-see-about-page-with-authz

Conversation

@BryanttV

@BryanttV BryanttV commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Description

When AuthZ course authoring is enabled for a course, can_see_about_page previously checked only COURSES_VIEW_COURSE and ignored catalog visibility and staff bypass. Learners, data researchers, beta testers, and course staff could be blocked from the about page even when legacy rules would have allowed access.

Supporting information

Testing instructions

Note

RBAC must be enabled globally, at the organization level, or for specific courses.

  1. As a learner (or beta tester/data researcher), access the course's about page; you should be able to view it without any issues.
  2. As a learner (or beta tester/data researcher), go to the course home; you should be able to see the course content without any issues.

Modify the Catalog Visibility Setting and Public Course Content from Studio > Advanced Settings. Everything should work according to the configuration (docs)

Screenshots

Before

image image

After

image image

Deadline

Verawood

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Jun 9, 2026
@openedx-webhooks

openedx-webhooks commented Jun 9, 2026

Copy link
Copy Markdown

Thanks for the pull request, @BryanttV!

This repository is currently maintained by @openedx/wg-maintenance-openedx-platform.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Jun 9, 2026
@BryanttV
BryanttV force-pushed the bav/fix-can-see-about-page-with-authz branch 2 times, most recently from 95a51b7 to 462c398 Compare June 9, 2026 22:43
@BryanttV
BryanttV marked this pull request as ready for review June 9, 2026 23:21
@BryanttV
BryanttV requested a review from MaferMazu June 9, 2026 23:21
@BryanttV
BryanttV force-pushed the bav/fix-can-see-about-page-with-authz branch from 462c398 to 28efc11 Compare June 9, 2026 23:25
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Jun 10, 2026
@MaferMazu MaferMazu added the verawood Released in Verawood label Jun 11, 2026
@BryanttV
BryanttV force-pushed the bav/fix-can-see-about-page-with-authz branch from 28efc11 to 32ef4b1 Compare June 11, 2026 14:05
@MaferMazu
MaferMazu requested review from bmtcril and rodmgwgu June 11, 2026 19:15

@MaferMazu MaferMazu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for this fix @BryanttV
This looks good. I just have a question and a suggestion related to it.

Comment thread lms/djangoapps/course_api/tests/test_api.py
Comment thread lms/djangoapps/courseware/access.py
Comment thread lms/djangoapps/courseware/access.py Outdated
Comment thread lms/djangoapps/courseware/tests/test_access.py Outdated
self.assertTrue(response) # noqa: PT009

def test_anonymous_user_uses_legacy_path(self):
"""Anonymous users are routed to the legacy path and follow catalog visibility."""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How are we checking for the paths being used here?

course_overview = CourseOverview.get_from_id(course.id)
return access.has_access(user, "see_about_page", course_overview, course_key=course.id)

def test_learner_granted_via_catalog_visibility_both(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's good we're adding more coverage here but if the course about visibility is already being covered by other tests I don't think we should add more. What do you think?

@BryanttV
BryanttV force-pushed the bav/fix-can-see-about-page-with-authz branch 2 times, most recently from 5f12ce4 to 9a6ce3d Compare June 18, 2026 21:41
@BryanttV
BryanttV force-pushed the bav/fix-can-see-about-page-with-authz branch from 9a6ce3d to 7663bb6 Compare June 19, 2026 17:18
Comment thread lms/djangoapps/courseware/access.py Outdated
):
return ACCESS_GRANTED

return _about_page_catalog_visibility_error()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's a bit confusing that we'd have to call _has_catalog_visibility to get an error, does it have to check for permissions again?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, there's no need to check again. I'm returning the error directly now. Thanks!

@mariajgrimaldi

Copy link
Copy Markdown
Member

Can we deploy this into our sandbox to test everything's working correctly? Thanks! You can post here when you run some QA there, so we can check as well. Thank you!

@mariajgrimaldi mariajgrimaldi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't want to block this further so I'll leave my approval since the code looks good to me! Thanks

@BryanttV
BryanttV force-pushed the bav/fix-can-see-about-page-with-authz branch from 7663bb6 to dba65df Compare June 22, 2026 14:43
@BryanttV
BryanttV force-pushed the bav/fix-can-see-about-page-with-authz branch from dba65df to 0e56ab1 Compare June 22, 2026 14:47
@BryanttV

Copy link
Copy Markdown
Contributor Author

@mariajgrimaldi, I deployed the changes, ran some tests, and everything is working correctly. You can test it if you'd like.

@MaferMazu MaferMazu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good to me. Thanks for addressing my feedback @BryanttV

@MaferMazu
MaferMazu merged commit 2260fd6 into openedx:master Jun 22, 2026
42 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for Review to Done in Contributions Jun 22, 2026
BryanttV added a commit to eduNEXT/edx-platform that referenced this pull request Jun 22, 2026
…penedx#38736)

* fix: preserve catalog and staff checks for authZ about-page access

* refactor: remove about page catalog visibility error function and return CatalogVisibilityError directly
MaferMazu pushed a commit that referenced this pull request Jun 25, 2026
* feat: add platform glob scope support (#38660)

* feat: add platform-wide authz scope support

* feat: enhance course listing authorization with global toggle support

* chore: upgrade openedx-authz to 1.19.0

* docs: add docstring for mock authorization toggle in course listing tests

* fix: add missing org scope support in instructor dashboard (#38721)

* feat: enhance role assignment handling for users with org-wide scopes

* refactor: update role assertion methods

* refactor: replace external_key initialization with build_external_key method

* refactor: streamline role assignment by directly using build_external_key method

* refactor: update role assignment scope initialization to use ScopeData

* refactor: introduce helper function to extract org and course ID from AuthZ scope

* refactor: replace has_access with administrative_accesses_to_course_for_user

* docs: clarify legacy-only CourseAccessRole query in studio course list

* refactor: simplify user role assignment retrieval by using scoped api method

* fix: preserve catalog and staff checks for authZ about-page access (#38736)

* fix: preserve catalog and staff checks for authZ about-page access

* refactor: remove about page catalog visibility error function and return CatalogVisibilityError directly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U verawood Released in Verawood

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[Test failure] TC-00598: User cannot access course content and the about page when RBAC is enabled

5 participants