tanuki v0.0.1 Tanuki.Users

Summary

Functions

PUT /users/:uid/block

DELETE /users/:id

GET /user

PUT /users/:uid/unblock

GET /users/:id

Functions

block(uid, client)

PUT /users/:uid/block

Blocks the specified user. Available only for admin.

create_user(params, client)

POST /users

Creates a new user. Note only administrators can create new users.

Parameters:

  • email (required) - Email
  • password (required) - Password
  • username (required) - Username
  • name (required) - Name
  • skype (optional) - Skype ID
  • linkedin (optional) - LinkedIn
  • twitter (optional) - Twitter account
  • website_url (optional) - Website URL
  • projects_limit (optional) - Number of projects user can create
  • extern_uid (optional) - External UID
  • provider (optional) - External provider name
  • bio (optional) - User’s biography
  • admin (optional) - User is admin - true or false (default)
  • can_create_group (optional) - User can create groups - true or false
  • confirm (optional) - Require confirmation - true (default) or false
delete_user(id, client)

DELETE /users/:id

Deletes a user. Available only for administrators. This is an idempotent function, calling this function for a non-existent user id still returns a status code 200 OK. The JSON response differs if the user was actually deleted or not. In the former the user is returned and in the latter not.

list(client, params \\ [])

GET /users

Without params, it lists all users call users(client, username: “root”) to search for user root (and only user root) Pass [{search: term}] to find all users associated with the term

me(client)

GET /user

Get all your own data! :simple_smile:

modify_user(id, params, client)

PUT /users/:id

Modifies an existing user. Only administrators can change attributes of a user. Note, at the moment this method does only return a 404 error, even in cases where a 409 (Conflict) would be more appropriate, e.g. when renaming the email address to some existing one.

Optional parameters:

  • email - Email
  • username - Usernamective=false
  • skype - Skype ID
  • linkedin - LinkedIn
  • twitter - Twitter account
  • website_url - Website URL
  • projects_limit - Limit projects each user can create
  • extern_uid - External UID
  • provider - External provider name
  • bio - User’s biography
  • admin - User is admin - true or false (default)
  • can_create_group - User can create groups - true or false
unblock(uid, client)

PUT /users/:uid/unblock

Unblocks the specified user. Available only for admin.

user_by_id(id, client)

GET /users/:id

Gets the user by id, response might vary on your own role