Commit Graph

17 Commits

Author SHA1 Message Date
stvn
016d2d8c3f Add content_type_gating_enabled flag to courseware API
to extend the Learner MFE.
2020-04-15 11:28:01 -07:00
stvn
aa1d0a54c7 Merge PR #23709 stv/mfe/learning/audit-access-expiration
* Commits:
  Add audit access expiration message to courseware_api
2020-04-15 11:05:45 -07:00
David Joy
7a400e2917 Factoring redirects out of check_course_access so it can be used with courseware_api (#23651)
TNL-7053

The courseware_api view will use check_course_access - which now returns AccessResponse objects, and all other uses of check_course_access will now use check_course_access_with_redirect, which is a drop-in replacement for the original check_course_access implementation.

We also added a few new helpers to access_utils:

- check_public_access is a replacement for allow_public_access, which now returns AccessResponse objects
 - check_enrollment checks if the learner is enrolled, and uses check_public_access to account for COURSE_ENABLE_UNENROLLED_ACCESS_FLAG
- check_survey checks whether there is a required survey that the learner must complete prior to accessing the course.

There are two new kinds of AccessError subclasses:

- SurveyRequiredAccessError
- EnrollmentRequiredAccessError
2020-04-15 10:29:24 -04:00
stvn
fb830eea88 Add audit access expiration message to courseware_api
to display the banner in the Learner MFE.
2020-04-13 18:01:50 -07:00
Dave St.Germain
543611fbb7 Added edxnotes information to the courseware API.
Added notes visibility toggle support for courseware MFE.
Removed notes and calculator from chromeless view when rendered in courseware MFE.
2020-04-09 13:59:01 -04:00
David Joy
1b84f815cc Add is_staff and can_load_course to the CourseInfoSerializer. 2020-04-03 14:17:28 -04:00
Adam Butterworth
8b7ff1ac2a Eliminate extra has staff access checks 2020-04-03 10:21:06 -04:00
Adam Butterworth
4363b1ede0 Refactor public course check to only call if needed 2020-04-03 09:55:28 -04:00
Adam Butterworth
ff33cc54dd fix lint error 2020-04-03 09:46:47 -04:00
David Joy
3b6a86bb68 fix: Improving access check in CoursewareInformation view
We weren’t using has_access to check user access, which meant we were missing out on a bunch of checks.  This PR adds a local _check_access function to CoursewareInformation.  Ideally we would add this into access.py, but we’re adding it here for now to avoid any unexpected regressions in editing more commonly used code.  This should ultimately be folded into our access system properly.

TNL-7053
2020-04-02 16:00:47 -04:00
Dave St.Germain
d0914ef40c Added 'show calculator' to courseware metadata 2020-03-23 12:00:11 -04:00
David Joy
13096ca586 Adding user_has_staff_access to course metadata response.
We use this value in the client to understand whether or not we should be showing staff-only parts of the UI to the user.

Related to: https://openedx.atlassian.net/browse/TNL-7109
2020-03-09 15:16:26 -04:00
Dave St.Germain
49c5d5194b Addressed review feedback 2020-03-09 11:28:48 -04:00
Dave St.Germain
b166788a8d Fixes TNL-7113 and TNL-7112, related to missing attributes in course tabs 2020-03-09 10:47:00 -04:00
Dave St.Germain
7d94408132 Add verified mode to the courseware API 2020-02-28 12:42:26 -05:00
Dave St.Germain
9da8ff0f0b Allow anonymous access to courseware API, and return error message if user is unenrolled. 2020-02-14 11:03:15 -05:00
Dave St.Germain
1aa8c9c53d Add a new courseware API Django app to support the courseware micro-frontend. 2020-01-28 14:59:07 -05:00