Organization

class labstep.entities.organization.model.Organization(data, user)
edit(name, extraParams={})

Edit Organization.

Parameters:

name (str) – The name of the Organization.

Returns:

An object representing the organization.

Return type:

Organization

Example

my_organization.edit(name='My new organization.')
inviteUsers(emails, workspace_id=OPTIONAL)

Invite users to your organization.

Parameters:
  • emails (list) – A list of email address to send invitations to.

  • workspace_id (int) – Optionally specifiy the id of a workspace to add the new users to.

Example

my_organization.inviteUsers(emails=['user1@labstep.com','user2@labstep.com'],
    workspace_id=123)
getWorkspaces(count=OPTIONAL, search_query=OPTIONAL)

Get the workspaces in your Organization

Parameters:
  • count (int) – Number of workspaces to return.

  • search_query (string) – Search for specific workspaces by name.

Returns:

A list of workspaces in the organization.

Return type:

List[Workspace]

Example

workspaces = my_organization.getWorkspaces(search_query='R&D Workspace')
getUsers(count=OPTIONAL, extraParams={})

Get the users in your Organization.

Returns:

A list of users in your organization

Return type:

List[OrganizationUser]

Example

users = my_organization.getUsers()
user[0].disable()
getPendingInvitations(extraParams={})

Get pending invitations to your Organization.

Returns:

A list of invitations sent

Return type:

List[Invitation]

Example

invitations = my_organization.getPendingInvititations()
newWorkspaceRole(name, extraParams={})

Create a new Workspace Role in your Organization.

Parameters:

name (str) – Name of the new Workspace Role.

Returns:

An object representing a Workspace Role in Labstep.

Return type:

WorkspaceRole

Example

new_workspace_role = my_organization.newWorkspaceRole(name='Inventory Manager')
getWorkspaceRoles(count=OPTIONAL, search_query=OPTIONAL, extraParams={})

Retrieve a list of organizations’s Workspace Role in Labstep, which can be filtered using the parameters:

Parameters:
  • count (int) – The number of Workspace Roles to retrieve.

  • search_query (str) – Search for Workspace Role with this ‘name’.

Returns:

A list of Workspace Roles objects.

Return type:

List[WorkspaceRoles]

Example

workspace_roles = my_organization.getWorkspaceRoles(search_query='Inventory')
getWorkspaceRole(workspace_role_guid)

Retrieve a specific Labstep Workspace Role entity.

Parameters:

workspace_role_guid (str) – The guid of the Workspace Role to retrieve.

Returns:

An object representing a Workspace Role on Labstep.

Return type:

WorkspaceRole

Example

workspace_role = my_organization.getWorkspaceRole(17000)

OrganizationUser

class labstep.entities.organizationUser.model.OrganizationUser(data, user)
setAdmin()

Gives a user admin permission over the organization.

Example

users = my_organization.getUsers()
user[0].setAdmin()
revokeAdmin()

Revokes admin permissions from a user.

Example

users = my_organization.getUsers()
user[0].revokeAdmin()
disable()

Disables a user account.

Example

users = my_organization.getUsers()
user[0].disable()

Workspace Role

class labstep.entities.workspaceRole.model.WorkspaceRole(data, user)
edit(name=OPTIONAL, extraParams={})

Edit an existing Workspace Role.

Parameters:

name (str) – The name of the Workspace Role.

Returns:

An object representing the edited Workspace Role.

Return type:

WorkspaceRole

Example

my_org = user.getOrganization()
workspace_role = my_org.getWorkspaceRole(10000)
workspace_role.edit(name='A New Workspace Role Name')
delete()

Delete an existing workspace Role.

Parameters:

Permission role (obj) – The workspace role to delete.

Return type:

None

Example

my_org = user.getOrganization()
workspace_role = my_org.getWorkspaceRole(10000)
workspace_role.delete()
setPermission(entityClass, action, permission_setting='all')

Grant users with this workspace role permission to perform certain actions for certain entity classes.

Parameters:
  • entityClass (obj) – The class of the entity to grant permission over.

  • action (str) – The action to grant permission for

  • permission_setting (boolean) – ‘all’ - Grants permission to perform the action all entities of the given class. ‘if_assigned’ - Grants permission to perform the action only for entities of the given class which the user has created or been assigned to. ‘none’ - Revokes any permission to perform the action for entities of the given class.

Returns:

Example

from labstep.entities.experiment.model import Experiment

my_org = user.getOrganization()
workspace_role = my_org.newWorkspaceRole('Lab Manager')
workspace_role.setPermission(Experiment,'edit','if_assigned')
getPermissions()

Return a list of the permissions that have been granted to this Workspace Role.

Parameters:

None

Returns:

Example

my_org = user.getOrganization()
workspace_role = my_org.getWorkspaceRole('Lab Manager')
permissions = workspace_role.getPermissions()

Workspace Role Permission

class labstep.entities.workspaceRolePermission.model.WorkspaceRolePermission(data, user)
revoke()

Revokes the permission from the workspace role.

Parameters:

None

Return type:

None

Example

my_org = user.getOrganization()
workspace_role = my_org.getWorkspaceRole('Lab Manager')
permissions = workspace_role.getPermissions()
permissions[0].revoke()