Skip to content

Fixed course being accessed from studio of another site - #595

Merged
muhammadali286 merged 1 commit into
develop-koafrom
manan/EDLY-7167
Nov 21, 2024
Merged

Fixed course being accessed from studio of another site#595
muhammadali286 merged 1 commit into
develop-koafrom
manan/EDLY-7167

Conversation

@manan-memon

Copy link
Copy Markdown

This PR fixes the issue of course endpoints of a different organization being accessed from another site for admin.

JIRA: https://edlyio.atlassian.net/browse/EDLY-7167

Comment thread common/djangoapps/student/auth.py Outdated
:param user:
:param course_key: a CourseKey
"""
# verify if the course is from requesting site

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: we can remove the inline comment.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed

Comment thread common/djangoapps/student/auth.py Outdated
Comment on lines +108 to +120
def is_course_org_in_site_filter_orgs(course_key):
"""
Check if the course organization is in the current site's organization filters.

:param course_key: a CourseKey object representing the course
:return: True if the course organization is in the site organization filters, False otherwise
"""
site_orgs = configuration_helpers.get_current_site_orgs()
if course_key.org not in site_orgs:
return False
return True


Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Isn't this function duplicate? Can you define a single function in EDLY app and import from there?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

As we discussed, I have changed it to use the is_course_org_same_as_site_org from edly app

@Anas-hameed Anas-hameed left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@muhammadali286
muhammadali286 merged commit 24e9dfb into develop-koa Nov 21, 2024
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.

5 participants