Skip to content
Snippets Groups Projects
Commit 8be8ac8f authored by Amir Qayyum Khan's avatar Amir Qayyum Khan
Browse files

Refactored ccx coach tab plugin

parent e1035c7b
No related merge requests found
......@@ -25,11 +25,12 @@ class CcxCourseTab(CourseTab):
"""
Returns true if CCX has been enabled and the specified user is a coach
"""
if not user:
return True
if not settings.FEATURES.get('CUSTOM_COURSES_EDX', False) or not course.enable_ccx:
# If ccx is not enable do not show ccx coach tab.
return False
if has_access(user, 'staff', course) or has_access(user, 'instructor', course):
# if user is staff or instructor then he can always see ccx coach tab.
return True
# check if user has coach access.
role = CourseCcxCoachRole(course.id)
return role.has_user(user)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment