I have resource endpoints that I would like to respond differently to the user that tries to access the endpoint.
Scenario
Let us say that I have a resource endpoint /users
, and the following UserTypes:
- GirlUser
- BoyUser
- Admin
When a GirlUser executes a GET
on /users
I want to only allow for other GirlUsers to be accessible. I would expect BoyUsers to have a similar result, and Admins to receive all users.
My Question
Is it more RESTful to:
- Handle this with different GrantTypes or Scopes through OAuth, using the one
/users
endpoint. - Have different endpoints, such as:
users/girls
,users/boys
, andusers/all
. - Have different APIs for the different types of users.
- I'm totally off-base with possible answers and it's something that I don't expect.
Would anything change if I have other endpoints that I would want to only be operational for a certain UserType?
(For example, ones that process payments.)
Thank you.