cc1  v2.1
CC1 source code docs
 All Classes Namespaces Files Functions Variables Pages
src.clm.views.admin_clm.user Namespace Reference

Functions

def activate
 Activates specified User.
def block
 Block/unblocks User account.
def delete
 Deletes User.
def edit
def get_by_id
def get_list
def set_admin
 Sets/unsets User as CLM admin.
def set_password

Detailed Description

Note
All functions here are decorated by src.clm.utils.decorators.admin_clm_log. It's recommended to read src.clm.utils.decorators.admin_clm_log docs before using functions below.

Function Documentation

def src.clm.views.admin_clm.user.activate (   cm_id,
  caller_id,
  user_id,
  wi_data 
)

Activates specified User.

Activation may require several actions, depending on instructions provided in CLM's config.py file.

Note
The clm.utils.decorators.admin_clm_log decorator performs CLMAdmin authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.admin_clm_log
Parameters
http_request(HttpRequest)
cm_id(POST int) session cm_id
login(POST string)
admin_password(POST string)
user_id(POST int) id of the User to activate
wi_data(POST dict) data for confirmation email
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (list(dict)) unlocked CMs available for user

Definition at line 102 of file user.py.

def src.clm.views.admin_clm.user.block (   cm_id,
  caller_id,
  user_id,
  wi_data,
  block 
)

Block/unblocks User account.

User should not and cannot be deleted. For technical and legal reasons in order to restrict its access to CC1 Cloud it should only be blocked. That way blocked User's data and activities stay stored in database. In case of detection of any suspicious / illegal activity performed on blocked User's Virtual Machine or using its Public IP, that activity may be associated with User account.

Note
The clm.utils.decorators.admin_clm_log decorator performs CLMAdmin authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.admin_clm_log
Parameters
http_request(HttpRequest)
cm_id(POST int) session cm_id
login(POST string)
admin_password(POST string)
user_id(POST int)
wi_data(POST dict) fields: 'site_name'
block(POST bool) whether to block or unblock.

Definition at line 144 of file user.py.

def src.clm.views.admin_clm.user.delete (   cm_id,
  caller_id,
  user_id 
)

Deletes User.

For technical and legal reasons only inactive User may be deleted. Other users may only be blocked.

Note
The clm.utils.decorators.admin_clm_log decorator performs CLMAdmin authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.admin_clm_log
Parameters
http_request(HttpRequest)
cm_id(POST int) session cm_id
login(POST string)
admin_password(POST string)
user_id(POST int) id of the User to delete

Definition at line 201 of file user.py.

def src.clm.views.admin_clm.user.edit (   cm_id,
  caller_id,
  user_id,
  first = None,
  last = None,
  organization = None,
  email = None 
)
Note
The clm.utils.decorators.admin_clm_log decorator performs CLMAdmin authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.admin_clm_log
Parameters
http_request(HttpRequest)
cm_id(POST int) session cm_id
login(POST string)
admin_password(POST string)
user_id(POST int) id of the user to edit
first(POST string) new firstname
last(POST string) new lastname
organization(POST string) new organization user belong to
email(POST string) new user's email
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (dict) edited User data after update, (User.dict() property)

Definition at line 49 of file user.py.

def src.clm.views.admin_clm.user.get_by_id (   cm_id,
  caller_id,
  user_id 
)
Note
The clm.utils.decorators.admin_clm_log decorator performs CLMAdmin authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.admin_clm_log
Parameters
http_request(HttpRequest)
cm_id(POST int) session cm_id
login(POST string)
admin_password(POST string)
user_id(POST int)
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (dict) requested User data (User.dict() property)

Definition at line 75 of file user.py.

def src.clm.views.admin_clm.user.get_list (   cm_id,
  caller_id 
)
Note
The clm.utils.decorators.admin_clm_log decorator performs CLMAdmin authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.admin_clm_log
Parameters
http_request(HttpRequest)
cm_id(POST int) session cm_id
login(POST string)
admin_password(POST string)
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (list(dict)) dict property for each User

Definition at line 86 of file user.py.

def src.clm.views.admin_clm.user.set_admin (   cm_id,
  caller_id,
  user_id,
  admin 
)

Sets/unsets User as CLM admin.

CLM admin has an ability to manage Cloud Users.

Note
The clm.utils.decorators.admin_clm_log decorator performs CLMAdmin authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.admin_clm_log
Parameters
http_request(HttpRequest)
cm_id(POST int) session cm_id
login(POST string)
admin_password(POST string)
user_id(POST int) id of the User to set superuser
admin(POST bool) if True - User becomes admin, if False - User loses admin priviledges

Definition at line 180 of file user.py.

def src.clm.views.admin_clm.user.set_password (   cm_id,
  caller_id,
  user_id,
  new_password 
)
Note
The clm.utils.decorators.admin_clm_log decorator performs CLMAdmin authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.admin_clm_log
Parameters
http_request(HttpRequest)
cm_id(POST int) session cm_id
login(POST string)
admin_password(POST string)
user_id(POST int) User id
new_password(POST string) new password

Definition at line 222 of file user.py.