Skip to content

Commit

Permalink
feat: add can_access_advanced_settings to studio home (openedx#35426)
Browse files Browse the repository at this point in the history
(cherry picked from commit 448edd7)
  • Loading branch information
0x29a committed Sep 13, 2024
1 parent 50470c1 commit 87e95fa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class CourseHomeSerializer(serializers.Serializer):
allow_empty=True
)
archived_courses = CourseCommonSerializer(required=False, many=True)
can_access_advanced_settings = serializers.BooleanField()
can_create_organizations = serializers.BooleanField()
course_creator_status = serializers.CharField()
courses = CourseCommonSerializer(required=False, many=True)
Expand Down
1 change: 1 addition & 0 deletions cms/djangoapps/contentstore/rest_api/v1/views/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def get(self, request: Request):
"allow_unicode_course_id": false,
"allowed_organizations": [],
"archived_courses": [],
"can_access_advanced_settings": true,
"can_create_organizations": true,
"course_creator_status": "granted",
"courses": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def test_home_page_courses_response(self):
"allow_unicode_course_id": False,
"allowed_organizations": [],
"archived_courses": [],
"can_access_advanced_settings": True,
"can_create_organizations": True,
"course_creator_status": "granted",
"courses": [],
Expand Down
1 change: 1 addition & 0 deletions cms/djangoapps/contentstore/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1712,6 +1712,7 @@ def get_home_context(request, no_course=False):
'allowed_organizations': get_allowed_organizations(user),
'allowed_organizations_for_libraries': get_allowed_organizations_for_libraries(user),
'can_create_organizations': user_can_create_organizations(user),
'can_access_advanced_settings': auth.has_studio_advanced_settings_access(user),
}

return home_context
Expand Down

0 comments on commit 87e95fa

Please sign in to comment.