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

Closed dominiquemariano closed 2 months ago

dominiquemariano commented 9 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 4 months 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.