Users
A ComodIT user. A user may have access to an organization and
therefore manage an organization’s sub-collections.
Representation
The following elements are defined as part of a user representation:
- username: The username of the user. Has to be unique ComodIT-wide.
- fullname: The full name of the user.
- email: The email address of the user (mandatory and unique ComodIT-wide).
- password: The password of the user. This value is write-only i.e. it is
never returned by ComodIT.
- role: The role of the user. Accepted values are ‘USER’ and ‘ADMIN’. A user
having ‘ADMIN’ role has access to additional user and account handling methods.
Only users with ‘ADMIN’ role may update their role or the role of another user.
Example
{
"username": "comodit",
"email": "noemail@nowhere.com",
"role": "USER"
"password": "secret"
}
Methods
Collection
/users
- POST: creates a new user. Only ‘ADMIN’ users may call this method.
Entity
/users/{username}
- GET: returns an existing user.
- PUT: updates an existing user.
- DELETE: deletes a user.
Other
/users/{username}/hosts
- GET: returns the list of hosts the user has access to.