User

class User(parent=None)

Bases: Item

This class describes an User object child of Item class.

connect(email='', password='')

Alias of signin()

demote()

Remove admin and super admin privilege.

Returns:

None

forgot_password(lagoon_url=None)

Start forgot password procedure. User will receive an email to reset its password.

Parameters:

lagoon_url (string, optional (default is api_url used during module initialisation)) – The Lagoon interface url. Useful if API url is not the same as Lagoon interface.

Returns:

True or False

Return type:

boolean

get_admin_status()

Return user admin status (None, ‘admin’ or ‘super admin’)

Returns:

Admin status of the user

Return type:

None or ‘admin’ or ‘super admin’

get_current()

Get the current user.

Returns:

User object

Return type:

User

get_profile()

Get the current profil.

Returns:

User, Usergroups and Organisations object

Return type:

Dict {user: User, usergroups: [Usergroup], organisations: [Organisation]}

get_tasks(project_key='', task_status='', task_name='', task_completed=False)

Gets the assigned task of the user

Parameters:
  • project_key (string) – The project key used to filter

  • task_status (string, optional) – The task status used to filter

  • task_name (string, optional) – The task nam used to filtere

  • task_completed (boolean, optional) – Filter the completed tasks

Returns:

List of Task object with there edge

Return type:

List of dict {item: Task, edge: Edge}

promote_as_admin()

Promote the user as admin.

Tip

Admin users can
  • administrate items

  • access administrative panel

Returns:

Membership edge object

Return type:

dict

promote_as_super_admin()

Promote the user as super admin.

Tip

Super admin users can
  • add/remove licenses, users and files

  • administrate items

  • access administrative panel

Returns:

A dict with the {user: participant, edge: the created permission edge}

Return type:

dict

set_data_variables(data={})

Sets the data variables of the User

Parameters:

data (dictionary) – The object item from Lagoon API

signin(email='', password='')

Sign in a user with it’s email and password

Parameters:
  • email (string) – The email of the user

  • password (string) – The password of the user

Returns:

Dictionary User object

Return type:

Dict {user: User}

signout()

Sign out the current user by clearing the stored authentication token

Note

After a signout(), you need to use a signin() before sending authenticated requests

Returns:

None