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

Functions

def activate_user
 Method activates user_id user in group group_id.
def change_owner
 Function changes owner of the specified group.
def create
 Creates new Group of Users.
def delete
 Method deletes specified Group.
def delete_user
 Method deletes membership of the specified user in specific group,.
def edit
 Method edits specified Group.
def get_by_id
 Method returns requested group.
def get_list
 Returns Group.dict property of each existing Groups, supplemented by callers membership status: ok, waiting or not member under user_status key.
def join_request
 Sends request for acceptation in specified Groupfor caller.
def list_groups
 Returns list of caller's Groups (only those where caller is accepted).
def list_members
 Method returns members of the group with id group_id.
def list_own_groups
 Method returns list of the groups caller is leader of.
def list_requests
 Function returns list of the users requesting acceptation in group with id group_id.

Detailed Description

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

Function Documentation

def src.clm.views.user.group.activate_user (   cm_id,
  caller_id,
  user_id,
  group_id 
)

Method activates user_id user in group group_id.

Activated user gains access to IsoImage-s shared by that group.

Parameters
user_id(POST int) id of the user to activate
group_id(POST int) id of the group in which user must be activated

Definition at line 263 of file group.py.

def src.clm.views.user.group.change_owner (   cm_id,
  caller_id,
  user_id,
  group_id 
)

Function changes owner of the specified group.

Only owner may be the caller, otherwise exception is thrown. user_id becomes new Group's leader.

Parameters
user_id(POST int) id of the new owner
group_id(POST int) id of the managed Group

Definition at line 320 of file group.py.

def src.clm.views.user.group.create (   cm_id,
  caller_id,
  name,
  description 
)

Creates new Group of Users.

Caller becomes its leader. He also becomes a member of that Group with ok state.

Note
The clm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
login(POST string)
cm_id(POST int) session cm_id
password(POST string)
name(POST string)
description(POST string)

Definition at line 47 of file group.py.

def src.clm.views.user.group.delete (   cm_id,
  caller_id,
  group_id 
)

Method deletes specified Group.

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

Definition at line 208 of file group.py.

def src.clm.views.user.group.delete_user (   cm_id,
  caller_id,
  user_id,
  group_id 
)

Method deletes membership of the specified user in specific group,.

Parameters
user_id(POST int) id of the user to delete from group
group_id(POST int) id of the managed group

Definition at line 290 of file group.py.

def src.clm.views.user.group.edit (   cm_id,
  caller_id,
  group_id,
  name = None,
  description = None 
)

Method edits specified Group.

Parameters
group_id(POST string) id of the group to edit
name(POST string) group's name
description(POST string) group's description

Definition at line 241 of file group.py.

def src.clm.views.user.group.get_by_id (   cm_id,
  caller_id,
  group_id 
)

Method returns requested group.

 @param group_id <i>(<b>POST</b> \c int)</i> id of the requested Group

 @returns HttpResponse with JSON content: 
  • response: response status,
  • data: (dict) requested Group's details

Definition at line 344 of file group.py.

def src.clm.views.user.group.get_list (   cm_id,
  caller_id 
)

Returns Group.dict property of each existing Groups, supplemented by callers membership status: ok, waiting or not member under user_status key.

Note
The clm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
login(POST string)
cm_id(POST int) session cm_id
password(POST string)
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (list(dict)) Group.dict property for each group, supplemented by user_status key.

Definition at line 104 of file group.py.

def src.clm.views.user.group.join_request (   cm_id,
  caller_id,
  group_id 
)

Sends request for acceptation in specified Groupfor caller.

 Adds caller to members  with 'waiting' state.
Note
The clm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
login(POST string)
cm_id(POST int) session cm_id
password(POST string)
group_id(POST int) id of the Group, which caller wants to become member of

Definition at line 77 of file group.py.

def src.clm.views.user.group.list_groups (   cm_id,
  caller_id 
)

Returns list of caller's Groups (only those where caller is accepted).

Note
The clm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
login(POST string)
cm_id(POST int) session cm_id
password(POST string)
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (list(dict)) Group.dict property for each caller's Group

Definition at line 136 of file group.py.

def src.clm.views.user.group.list_members (   cm_id,
  caller_id,
  group_id 
)

Method returns members of the group with id group_id.

Note
The clm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
login(POST string)
cm_id(POST int) session cm_id
password(POST string)
group_id(POST int) id of the Group that we get list of
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (list(dict)) dicts describing users belonging to specifie group.

Definition at line 157 of file group.py.

def src.clm.views.user.group.list_own_groups (   cm_id,
  caller_id 
)

Method returns list of the groups caller is leader of.

Note
The clm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
login(POST string)
cm_id(POST int) session cm_id
password(POST string)
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (list(dict)) dicts describing groups led by caller

Definition at line 173 of file group.py.

def src.clm.views.user.group.list_requests (   cm_id,
  caller_id,
  group_id 
)

Function returns list of the users requesting acceptation in group with id group_id.

Note
The clm.utils.decorators.user_log decorator performs User authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.user_log
Parameters
http_request(HttpRequest)
login(POST string)
cm_id(POST int) session cm_id
password(POST string)
group_id(POST int) id of the group which we check membership requests for
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (list(dict)) dicts describing requesting users

Definition at line 192 of file group.py.