-
Notifications
You must be signed in to change notification settings - Fork 198
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
Allow additional users to manage students #7700
Conversation
Test the previous changes of this PR with WordPress Playground. |
Test the previous changes of this PR with WordPress Playground. |
Test the previous changes of this PR with WordPress Playground. |
Test the previous changes of this PR with WordPress Playground. |
Test the previous changes of this PR with WordPress Playground. |
Test the previous changes of this PR with WordPress Playground. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. I've left one very small comment.
For the hook, I would have gone with filtering the $can_manage_student
value instead of filtering the user IDs to keep things simpler, but I'm OK either way. 🙂
Co-authored-by: Miroslav Mitev <[email protected]>
Test the previous changes of this PR with WordPress Playground. |
Part of https://github.com/Automattic/sensei-pro/issues/2618.
Proposed Changes
Add a filter to allow additional users to manage students (admins and teacher are the default).
Instead of using a hook, I debated changing the
manage_sensei
check tomanage_sensei_grades
, but this cap feels like it should be restricted to the Grading menu based on its naming. Perhaps we could consider adding a new one for student management in the future?I was only able to add a couple of test cases, as most of the functions that were changed call
exit
, so I tested the use cases wherereturn
is called before anexit
.Testing Instructions
See https://github.com/Automattic/sensei-pro/pull/2619.
New/Updated Hooks
sensei_learners_allowed_user_ids
- Filter the user IDs that have permission to manage students.Pre-Merge Checklist