Optionally require logins for certificate views

Description

We'd like to optionally require logins for viewing and downloading certificates. This adds a waffle switch which when enabled uses the django `login_required`decorator on the certificate views.

This also adds the certificate status to the GeneratedCertificates admin page view.

*JIRA tickets*: Implements BB-1388.

*Dependencies*: None

*Sandbox URL*: https://pr20957.sandbox.opencraft.hosting/

*Testing instructions*:

1. Generate a certificate to test with.
```
/edx/bin/{python,manage}.edxapp lms --settings=devstack_docker generate_fake_cert verified course-v1:edX+DemoX+Demo_Course
```
2. Check the certificate renders normally with no login required in an logged-out browser: http://localhost:18000/certificates/user/8/course/course-v1:edX+DemoX+Demo_Course
3. Enable the waffle switch
```
/edx/bin/{python,manage}.edxapp lms --settings=devstack_docker waffle_switch certificates.require_login on
```
4. Check the certificate page again and ensure it requires login now.

*Author notes and concerns*:

1. Should we create a waffle configuration in a new file for the certificates application?

*Reviewers*

  • [ ] (@giovannicimolin )

  • [ ] edX reviewer[s] TBD

Activity

Show:
Braden MacDonald
January 13, 2021, 11:38 PM

Yes, it's blocked on https://github.com/edx/edx-django-utils/pull/64 - I think that's also already indicated in Jira here.

Natalia Berdnikov
January 13, 2021, 4:56 PM

Is this ticket blocked by anything, or can your review proceed?

Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Braden MacDonald

Reporter

Open Source Pull Request Bot

Contributor Name

Josh McLaughlin

Repo

edx/edx-platform

Customer

Github Lines Added

3

Github Lines Deleted

0