gocodebox / lifterlms-rest

LifterLMS REST API Feature Plugin
6 stars 7 forks source link

Student endpoint /wp-json/llms/v1/students also returns non-students. #330

Open dominiquemariano opened 6 months ago

dominiquemariano commented 6 months ago

Reproduction Steps

  1. Create a new WordPress user with a non-student role (e.g., new subscriber or new editor).
  2. Use the endpoint /wp-json/llms/v1/students to retrieve the list of students.

Expected Behavior

The new subscriber without the student role should not be included in the data returned by /wp-json/llms/v1/students .

Actual Behavior

The new subscriber without the student role is included in the data returned by /wp-json/llms/v1/students .

brianhogg commented 1 month ago

It looks like the /wp-json/llms/v1/instructors endpoint has the same issue and returns all users.

The examples in the documentation have roles=student,customer and roles=instructor added in order to only show users with those roles. This would be in the default.