feat: add can_access_advanced_settings to studio home (#35426)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -52,6 +52,7 @@ class HomePageView(APIView):
|
||||
"allow_unicode_course_id": false,
|
||||
"allowed_organizations": [],
|
||||
"archived_courses": [],
|
||||
"can_access_advanced_settings": true,
|
||||
"can_create_organizations": true,
|
||||
"course_creator_status": "granted",
|
||||
"courses": [],
|
||||
|
||||
@@ -44,6 +44,7 @@ class HomePageViewTest(CourseTestCase):
|
||||
"allow_unicode_course_id": False,
|
||||
"allowed_organizations": [],
|
||||
"archived_courses": [],
|
||||
"can_access_advanced_settings": True,
|
||||
"can_create_organizations": True,
|
||||
"course_creator_status": "granted",
|
||||
"courses": [],
|
||||
|
||||
@@ -1716,6 +1716,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
|
||||
|
||||
Reference in New Issue
Block a user