title: Correct way of defining REST endpoints for user management
body: <p>I have a typical user management module for which I want create REST APIs. User should be able to access his/her details but shouldn't be allowed to access other user details. Being an administrator user should be able to fetch any user or remove any user.</p>
  
  <p>This is how I am planning to create URL end points, any suggestions ?</p>
  
  <pre><code># To create/register user
  POST /api/users/
  # or
  POST /api/register/
  
  # To get all users
  # This will be allowed to access only by admins.
  GET /api/users/
  
  # To get current user.
  # For admin, allowed
  # For regular user, id will be validated against userid stored in the session.
  GET /api/users/&lt;id&gt;/
  
  # To update current user.
  # This id will be validated against userid stored in the session.
  PUT /api/users/&lt;id&gt;/
  
  # To delete current user.
  # For admin, allowed
  # This id will be validated against userid stored in the session.
  DELETE /api/users/&lt;id&gt;/
  
  # Login
  POST /api/login/
  
  # Logout
  GET /api/logout/
  </code></pre>
  
  <p>Thank you</p>