Skip to content

Conversation

@Anindra123
Copy link
Collaborator

Issue 1: missing authorization checks in the ajax_coupon_details()

  • This allows any user to get coupon details by passing coupon id.
  • To fix this i have added tutor_utils()->check_current_user_capability() to check if current user is admin.

Issue 2: Missing course belong to instructor check on course_list_bulk_action()

  • On the course_list_bulk_action() method there is check whether current user is instructor but it is not check if the bulk course ids belong to the instructor, this allows instructor to delete admins course and other instructor course
  • To fix this I at first obtain the list of course ids from the bulk ids
  • After that i filter the course_ids array to includes those ids only that the instructor has access using the method tutor_utils()->is_instructor_of_this_course() , this method also check if current instructor is a co-author of a course
  • After filtering the array the remaining ids are converted into string again and the action is performed

@shewa12 shewa12 merged commit 231f2f6 into dev Jan 27, 2026
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants