Skip to content

Updating permissions checks in the AJAX handler.#2895

Merged
ideadude merged 27 commits intotrunkfrom
fix/access-plan-remove
Mar 17, 2025
Merged

Updating permissions checks in the AJAX handler.#2895
ideadude merged 27 commits intotrunkfrom
fix/access-plan-remove

Conversation

@ideadude
Copy link
Copy Markdown
Member

@ideadude ideadude commented Mar 17, 2025

Description

Added additional permissions checks to callback functions triggered via AJAX where appropriate.

We also removed some deprecated methods of the LLMS_AJAX_Handler class, including:

  • query_students
  • create_section
  • get_course_sections
  • get_course_section
  • update_course_section
  • create_lesson
  • get_lesson_options_for_select
  • add_lesson_to_course
  • get_course_lesson
  • update_course_lesson
  • remove_course_lesson
  • delete_course_section
  • update_section_order
  • update_lesson_order

We also added the function llms_current_user_can_edit_product() which takes a product_id (for a course or membership) and returns if the current user can edit that course or membership. This makes the permissions checks for products more clear.

How has this been tested?

We've created AJAX calls for each method and confirmed the new or existing permissions checks keep unwanted actions from occuring.

We also tested across the whole application to make sure these changes aren't affecting legitimate use of the software.

Checklist:

  • This PR requires and contains at least one changelog file.
  • My code has been tested.
  • My code passes all existing automated tests.
  • My code follows the LifterLMS Coding & Documentation Standards.

@ideadude ideadude moved this to Awaiting Review in Development Mar 17, 2025
@ideadude ideadude merged commit d711711 into trunk Mar 17, 2025
25 of 29 checks passed
@ideadude ideadude deleted the fix/access-plan-remove branch March 17, 2025 13:43
@github-project-automation github-project-automation bot moved this from Awaiting Review to Done in Development Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants