Commit Graph

34 Commits

Author SHA1 Message Date
David Joy
c6ae82db57 Implement kill-switch for the Learning MFE
by overriding can_load_courseware if the MFE is disabled for the user

If the user would be allowed to see the courseware MFE
(can_load_courseware), we check whether the MFE is disabled for them,
based on global settings, course settings (mongo courses), or their
particular bucketing in our ExperimentWaffleFlag.

If we determine they shouldn’t be allowed to see it, we return a new
CoursewareMicrofrontendDisabledAccessError access response, which the
MFE will use to know it should redirect to the old LMS experience.

Fixes: TNL-7362
Co-authored-by: stvn <stvn@mit.edu>
2020-08-13 12:05:49 -07:00
Manjinder Singh
c76ed6ae45 Extracting plugin app from edx-platform (#24678)
* Moving plugins infrastructure to edx-django-utils
This PR extracts the code that enables plugins in edx-platform and puts it in edx-django-utils. This is done to allow other IDAS to add plugin functionality.
2020-08-12 07:48:53 -04:00
Dillon Dumesnil
c66bc865b6 AA-275: Persist Masquerade User staff status
We need both the original user's staff status as well as
the staff status of the user being masqueraded as.
2020-08-05 08:03:55 -07:00
Patrick Cockwell
129ed1b9ab TNL-7303 Add course license details to Courseware API (#24393) 2020-07-17 10:15:21 -04:00
Michael Terry
3030efec78 AA-177: Add masquerading for course home MFE
- Looks at masquerading config for dates, outline, metadata, and
  celebration APIs in course_home_api / courseware_api.
- Consolidates and cleans up places we check whether masquerading
  gives us full access to a course.
2020-06-29 12:37:47 -04:00
stvn
994b2b002f Add explicit masquerade support to courseware API 2020-06-18 14:54:49 -07:00
Michael Terry
450072582e AA-137: Support courseware celebrations
- Add a new CourseEnrollmentCelebration model, which ties a
  course enrollment to some booleans about progress celebrations
- Add serialization of the new model to the existing courseware_api
  app's existing course info view
- Add new API in courseware_api to update a celebration model
2020-06-16 15:19:21 -04:00
Michael Terry
f88b4d75f0 Add marketing_url to courseware_api
This will let the courseware MFE point at a course's marketing page.

AA-137
2020-06-05 09:10:15 -04:00
stvn
0f57bff0cb Merge PR #23979 fix/courseware-api-verified-mode
* Commits:
  Check if user can upgrade prior to showing sock upgrade
2020-05-14 15:50:16 -07:00
stvn
51803d33ff Check if user can upgrade prior to showing sock upgrade 2020-05-14 15:09:04 -07:00
Dave St.Germain
687d223309 Added a courseware API endpoint to return the last completed block/unit/section. 2020-05-14 07:55:02 -04:00
edX requirements bot
5724432741 Python Requirements Update (#23984)
* Updating Python Requirements

* Constrain django-cookies-samesite until dep bug fixed

* Fix PEP 8 problems revealed by pycodestyle upgrade

Co-authored-by: Tim McCormack <tmccormack@edx.org>
Co-authored-by: Jeremy Bowman <jbowman@edx.org>
2020-05-13 20:24:30 +00:00
Adam Butterworth
a889536dbd Add the appropriate auth classes to courseware api views (#23901)
Allows users who are logged in but have not activated their accounts to be considered authenticated for the purpose of the courseware api
2020-05-05 13:37:24 -04:00
Dave St.Germain
2def3f427d Fixes hidden tabs showing up in courseware MFE. TNL-7149
Refactors courseware metadata code.
Enables masquerading in the courseware metadata API.
2020-04-30 12:19:43 -04:00
Dave St.Germain
0c67d91b16 Merge pull request #23774 from edx/dcs/tabfields
TNL-7148 -- support external links in courseware API
2020-04-29 09:31:14 -04:00
stvn
0fa6099802 Get upgrade offer banner HTML in courseware API
for use in the Learning MFE.
2020-04-22 14:14:55 -07:00
Dave St.Germain
1f71b7dc4b TNL-7148
This adds another field to the CourseOverviewTab model to support external links.
2020-04-21 12:16:24 -04:00
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