Package cm_api :: Package endpoints :: Module users
[hide private]
[frames] | no frames]

Module users

source code

Classes [hide private]
  ApiUser
Functions [hide private]
 
get_all_users(resource_root, view=None)
Get all users.
source code
 
get_user(resource_root, username)
Look up a user by username.
source code
 
create_user(resource_root, username, password, roles)
Create a user.
source code
 
delete_user(resource_root, username)
Delete user by username.
source code
 
update_user(resource_root, user)
Update a user.
source code
Variables [hide private]
  USERS_PATH = '/users'
  __package__ = 'cm_api.endpoints'
Function Details [hide private]

get_all_users(resource_root, view=None)

source code 

Get all users.

Parameters:
  • resource_root - The root Resource object
  • view - View to materialize ('full' or 'summary').
Returns:
A list of ApiUser objects.

get_user(resource_root, username)

source code 

Look up a user by username.

Parameters:
  • resource_root - The root Resource object
  • username - Username to look up
Returns:
An ApiUser object

create_user(resource_root, username, password, roles)

source code 

Create a user.

Parameters:
  • resource_root - The root Resource object
  • username - Username
  • password - Password
  • roles - List of roles for the user. This should be [] or ['ROLE_USER'] for a regular user, ['ROLE_ADMIN'] for an admin, or ['ROLE_LIMITED'] for a limited admin.
Returns:
An ApiUser object

delete_user(resource_root, username)

source code 

Delete user by username.

Parameters:
  • resource_root - The root Resource object
  • username - Username
Returns:
An ApiUser object

update_user(resource_root, user)

source code 

Update a user.

Replaces the user's details with those provided.

Parameters:
  • resource_root - The root Resource object
  • user - An ApiUser object
Returns:
An ApiUser object