Teams & Roles¶
Quantinuum Nexus offers secure and flexible ways of sharing data and managing workflows. To that end we have the following concepts:
Team
: a group of users.Roles
: a named role with specific permissions.
A Role
can be assigned to a Team
or User
to give specific permissions on a particular Project
or resource in Nexus.
These are concepts are related purely to collaboration and permissions, and are not related to metering or quotas.
from datetime import datetime
import qnexus as qnx
# List teams I am a member of
qnx.teams.get_all().df()
# Create a new Team
my_team = qnx.teams.create(name=f"My Team, created on {datetime.now()}")
Assigning a Role to a Team¶
By default when you create a Project, only you will be able to view/manage the contents of that project.
Lets take the team we created and give it a Contributor
role on a new Project.
# Get possible roles in Nexus and render them in a DataFrame
nexus_roles = qnx.roles.get_all()
nexus_roles.df()
my_new_project = qnx.projects.create(name=f"My project with {my_team.name} team")
# Assign a contributor role to the team on my new project
qnx.roles.assign_team(resource_ref=my_new_project, team=my_team, role="Contributor")
# View the assigned roles on a particular project or resource
qnx.roles.assignments(resource_ref=my_new_project).df()