Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow instructors to manage certificates #31265

Merged

Conversation

dcoa
Copy link
Contributor

@dcoa dcoa commented Nov 7, 2022

Description

Currently only super admin and staff are able to configure the certificates for the course.

This PR allows course instructors (admin course permissions) to manage certificates through all the actions available in the tab instructor > certificates, in this way, each instructor will be able to manage their certificates, which allows more granularity on the permissions granted to users. The staff permission is a somewhat dangerous permission, since it grants access to a wide variety of functions, with this change the instructors (who already manage the users, cohorts, and others) will also be able to manage the certificates.

This feature is used for eduNEXT due to client requests and we think is useful for the community, we put this into consideration for product reviewers (@santiagosuarezedunext @jmakowski1123 ).

Testing instructions

  1. Enable these FEATURES in your environment (to activate all certificate options):
  CERTIFICATES_INSTRUCTOR_GENERATION: true
  CUSTOM_CERTIFICATE_TEMPLATES_ENABLED: true
  1. Create a course with a certificate.
  2. Create a new user without special permissions (superuser, staff).
  3. Add the user to the course team as Admin (i.e. Instructor) via the instructor > membership tab.
    image
  4. The certificate tab should be visible and all the certificate operations should work (certificate generation, whitelist, self generation, etc)
    Screenshot from 2022-11-04 20-38-01

C.C @MaferMazu @Alec4r @felipemontoya @Ian2012

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 7, 2022
@openedx-webhooks
Copy link

openedx-webhooks commented Nov 7, 2022

Thanks for the pull request, @dcoa! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@dcoa dcoa force-pushed the dcoa/intructor-certificates-generation branch from 305196d to 4d4483d Compare November 8, 2022 15:24
@dcoa dcoa marked this pull request as ready for review November 8, 2022 15:31
@jmakowski1123 jmakowski1123 added the product review PR requires product review before merging label Nov 8, 2022
@openedx-webhooks openedx-webhooks removed the product review PR requires product review before merging label Nov 11, 2022
@felipemontoya felipemontoya added the product review PR requires product review before merging label Nov 11, 2022
@openedx-webhooks openedx-webhooks removed the product review PR requires product review before merging label Nov 13, 2022
@MaferMazu
Copy link
Contributor

I think this is a good feature to take into consideration, several of our clients request it. What do you think @jmakowski1123 @santiagosuarezedunext?

@jmakowski1123 jmakowski1123 added the product review PR requires product review before merging label Dec 12, 2022
@mphilbrick211
Copy link

@jmakowski1123 @ProductRyan - flagging for you as it looks like this is awaiting Product approval.

@mphilbrick211
Copy link

Putting this back on the radar @jmakowski1123 and @ProductRyan.

@mphilbrick211
Copy link

Hi @dcoa - just checking in on this to see if the tests will be run? Looks like they may need to be re-run.

@dcoa dcoa force-pushed the dcoa/intructor-certificates-generation branch from 4d4483d to 58bde8b Compare February 10, 2023 09:31
@dcoa
Copy link
Contributor Author

dcoa commented Feb 10, 2023

Hi @mphilbrick211 yes it's okay re-run the test

@mphilbrick211 mphilbrick211 added the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Feb 10, 2023
@e0d
Copy link
Contributor

e0d commented Feb 14, 2023

@mphilbrick211 tests running.

@jmakowski1123
Copy link

Hi @dcoa ! Thanks for the contribution! As this is a feature that will impact end-users, it will need to undergo product review. To start that process, I've created a Feature Ticket, which contains a checklist of the information needed to help the reviewing product manager evaluate and make an approval decision.

We'd like to get some more information from you regarding the potential impact of this permissions change for staff users, which as you note, can be a dangerous set of permissions. For example, does the decision to extend course instructors this new role still lie with superusers and/or course staff? Are there unintended risks, such as the Instructor getting access to additional permissions that they shouldn't? How would this risk be mitigated? Can this role expansion be managed at both the course and instance level? If you could provide additional information along these lines directly in the Feature Ticket, that will enable us to start the product review! We'll use the Feature Ticket to manage all product-related communications and decisions as well. Thanks! cc @mphilbrick211

@e0d e0d removed the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Feb 16, 2023
@mphilbrick211
Copy link

@mphilbrick211
Copy link

Hi @dcoa! While this item is in product review, would you mind re-running the tests on this pull request? We've had some new ones pop up (Shellcheck) that need to be run. Thanks!

@MaferMazu
Copy link
Contributor

Hello @mphilbrick211, any update with this PR?

@mphilbrick211
Copy link

Hello @mphilbrick211, any update with this PR?

Hi @MaferMazu! Please check out this thread. This is on hold for now., though I've pinged Product again to see if they have an update.

@mphilbrick211 mphilbrick211 requested a review from a team February 21, 2024 16:47
@mphilbrick211 mphilbrick211 added the waiting for eng review PR is ready for review. Review and merge it, or suggest changes. label Feb 21, 2024
@mphilbrick211
Copy link

Hi @openedx/2u-aperture @jsnwesson! Could you please review / merge this for us? Product review is complete. Thanks!

@deborahgu
Copy link
Member

added to our prioritization queue, @mphilbrick211, hopefully we will get to it next week. In the meantime if someone gets a chance to look at the conflicts that would be great.

@deborahgu deborahgu added the needs maintainer attention Issue or PR specifically needs the attention of the maintainer. label Feb 21, 2024
@mphilbrick211
Copy link

added to our prioritization queue, @mphilbrick211, hopefully we will get to it next week. In the meantime if someone gets a chance to look at the conflicts that would be great.

Thank you, @deborahgu!

@dcoa @MaferMazu would it be possible to resolve the branch conflicts so Aperture can review?

@MaferMazu
Copy link
Contributor

We resolve the conflicts, but we need to look at this comment: openedx/platform-roadmap#230 (comment) because I'm not sure we are fulfilling that.

@@ -15,6 +15,11 @@
ENABLE_CERTIFICATE_GENERATION = 'instructor.enable_certificate_generation'
GENERATE_CERTIFICATE_EXCEPTIONS = 'instructor.generate_certificate_exceptions'
GENERATE_BULK_CERTIFICATE_EXCEPTIONS = 'instructor.generate_bulk_certificate_exceptions'
GENERATE_EXAMPLE_CERTIFICATES = 'instructor.generate_example_certificates'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is GENERATE_EXAMPLE_CERTIFICATES still viable these days? I thought generating example certificates were related to PDF certificates, and this functionality has been gutted from edx-platform for quite some time.

@justinhynes
Copy link
Contributor

@dcoa I may be missing it, but according to the discussion here: openedx/platform-roadmap#230, my assumption was that there would be a waffle or configuration switch to enable this on a deployment.

I don't think we want this functionality at 2U. This PR appears like it would be enabled and give access to this functionality in the instructor dashboard by default to all members of the course team.

Can it be gated and configurable?

Copy link
Contributor

@justinhynes justinhynes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any configuration/setting that gates this configuration for Open edX instances where we don't want course teams to have access to this functionality?

@@ -499,7 +499,6 @@
}

// hide the fancy
.accomplishment-signatories .signatory-signature,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this change? Was this supposed to be included?

@jmakowski1123
Copy link

@dcoa I may be missing it, but according to the discussion here: openedx/platform-roadmap#230, my assumption was that there would be a waffle or configuration switch to enable this on a deployment.

I don't think we want this functionality at 2U. This PR appears like it would be enabled and give access to this functionality in the instructor dashboard by default to all members of the course team.

Can it be gated and configurable?

Yes, the requirement in the product review was to implement behind a feature flag. Maybe it was simply overlooked and can be added now?

@hurtstotouchfire hurtstotouchfire added waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. and removed waiting for eng review PR is ready for review. Review and merge it, or suggest changes. labels Feb 27, 2024
@dcoa
Copy link
Contributor Author

dcoa commented Feb 27, 2024

Hi @justinhynes,

As we explained here, we haven't applied the change that PWG asked for but we will work on that.

We resolve the conflicts, but we need to look at this comment: openedx/platform-roadmap#230 (comment) because I'm not sure we are fulfilling that.

@dcoa dcoa force-pushed the dcoa/intructor-certificates-generation branch 2 times, most recently from 634aec2 to 4594dfc Compare March 11, 2024 03:02
@dcoa
Copy link
Contributor Author

dcoa commented Mar 13, 2024

hi, @justinhynes, I create the flag.

@dcoa dcoa requested a review from justinhynes March 13, 2024 00:03
@arbrandes arbrandes self-requested a review March 13, 2024 14:12
@jsnwesson jsnwesson removed the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Mar 13, 2024
@dcoa dcoa force-pushed the dcoa/intructor-certificates-generation branch from 2d81e4a to 7a8cbf7 Compare March 13, 2024 21:32
Squirrel18 and others added 6 commits March 14, 2024 11:40
Define permissions using bridgekeeper for views related to certificates.

Add support to instructor certificates generation.
If user has instructor permissions over a course, the staff permissions are also granted.
@dcoa dcoa force-pushed the dcoa/intructor-certificates-generation branch from 7a8cbf7 to 417d2bc Compare March 14, 2024 00:40
@deborahgu
Copy link
Member

thanks, @dcoa, we'll review now that the flag exists.

@justinhynes
Copy link
Contributor

I plan on taking another look at this today, thanks for the heads up @dcoa :)

Copy link
Contributor

@justinhynes justinhynes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! I'll plan on merging this today too.

@justinhynes justinhynes merged commit 490a3d4 into openedx:master Mar 20, 2024
67 checks passed
@openedx-webhooks
Copy link

@dcoa 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs maintainer attention Issue or PR specifically needs the attention of the maintainer. open-source-contribution PR author is not from Axim or 2U product review PR requires product review before merging
Projects
Status: Done
Archived in project
Development

Successfully merging this pull request may close these issues.