# Roles and access

Who can see and change what in an org: the org roles, the product and teamspace roles, and how access to a product is given.

Access in EasyCode has three layers. Your **org role** says what you can do across the org. Your **teamspace role**
says whether you lead a team. Your **product role** says what you can do on one product. The same rules apply in the
web app, the desktop app and the tools a session uses.

## Org roles

| Role       | Who it is for                                 | What it adds                                                                                                                                                                                                                                                |
| ---------- | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Owner**  | The people accountable for the org            | Everything an admin can do, plus making and removing other owners                                                                                                                                                                                           |
| **Admin**  | The people who run the org                    | Org settings, members and invitations, teamspaces, products, repos and the GitHub App, the audit log, session policy, library and knowledge settings, integrations and provider keys. Admins act as maintainer on every product and lead of every teamspace |
| **Member** | Everyone on the team                          | Sees every open and closed teamspace, reads the library, proposes changes, searches code, starts sessions and works on the products they hold a role on                                                                                                     |
| **Guest**  | People outside the team, such as a contractor | Sees only what they are explicitly given: a named teamspace, a product or an artifact. No library, no code search, and read-only on documents                                                                                                               |

Only an owner can make someone an owner, change an owner's role, remove an owner or revoke an owner's invitation.
Anyone can leave an org on their own.

## Teamspace roles

A teamspace has **leads** and **members**. A lead manages the teamspace: its name, its people and its library assets'
properties. Admins lead every teamspace. A guest can be a member of a named teamspace but never a lead, and never a
member of **Everyone**, the default teamspace.

Who sees a teamspace depends on its visibility. Every full member sees an _open_ or _closed_ teamspace. A _private_
teamspace is seen only by its members and by admins.

## Product roles

| Role            | What it can do on the product                                                                                                                                                                      |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Viewer**      | See the product, its tasks, its sessions' metadata and its knowledge. Comment on its documents and artifacts                                                                                       |
| **Contributor** | Everything a viewer can, plus create tasks, start workflow runs, edit general tasks and documents, read and pick up teammates' shared sessions, and propose library changes at the product's scope |
| **Maintainer**  | Everything a contributor can, plus manage the product, assign tasks, cancel runs, set up and index its knowledge, and edit its library assets' properties                                          |

### How you get a product role

A product role is granted to a teamspace or to a person. The org can also give every full member a base role on a
product. When several grants reach you, you hold the highest one. Admins hold maintainer on every product.

A guest's product role is capped: a guest reads documents but never edits them, and never starts a run.

## Sessions

- **Your own sessions** are always yours to read, continue and hand to someone else.
- **A teammate's session** shows its title, status and cost to anyone who can see its product.
- **Its content**, meaning the transcript, comments and pick-up, needs four things. The session isn't Private,
  the org has content on, you are a contributor or maintainer on its product, and you can read its repo on GitHub.
  This applies to admins too.
- A session with no product is its owner's alone.

## The library

Every full member reads the library and can propose a change wherever they can see: the org, their teamspaces,
their products, and their own personal scope. **Publishing** a change at the org, teamspace or product scope is an
admin's decision. A teamspace's lead or a product's maintainer can edit an asset's properties, such as its title and
tags. An agent never publishes, even in an admin's session.

## Work and approvals

- Contributors create tasks and start runs on their product. Maintainers and admins assign tasks, and a run can be cancelled by its owner, the product's maintainers or an admin.
- The person a task is assigned to runs it.
- A gate is decided by an eligible approver, a person in the web or desktop app. A session or the CLI can never
  approve one.
- Git actions such as **Create PR** need a click from the session's owner, on their own machine.

## What admins configure

Org settings show a section to the roles that can use it. **General**, **Repos**, **Sessions**, **Voice** and
**Knowledge** are for owners and admins. **Library**, **Design** and **Integrations** show to every full member.
**Members**, **Teamspaces** and **Products** show to everyone, guests included. A section whose module is off is
hidden.

To give people access, see [Org, members and teamspaces](/setup/org-members-teamspaces) and
[Products and repos](/setup/products-and-repos).
