Users management API.
- Source:
Methods
(static) canRetrieve()
- Source:
An authenticated user can retrieve himself. Administrators can retrieve anyone.
(static) fetchMe()
- Source:
Middleware that attaches the authenticated user to the request in a similar manner to fetchUser
.
(static) fetchUser()
- Source:
Middleware that fetches the user identified by the ID in the URL.
(static) retrieve()
- Source:
Retrieves a single user.
(static) serialize(req, user) → {object}
- Source:
Serializes a user for API responses.
Detailed properties of a user can only be seen by the user itself or an administrator.
Parameters:
Name | Type | Description |
---|---|---|
req |
Request | The Express request object. |
user |
User | A user record. |
Returns:
A serialized user.
- Type
- object