# Invite people and assign roles

AI agent getting started? Read [Agents: start here](https://docs.openeng.io/agents/start-here.md) first.

Give people the access they need in your organisation and projects.

Source: https://docs.openeng.io/team/membership/

Membership gives a person a role in an organisation or project. Use organisation roles for access across the team and project roles for a narrower responsibility.

## Invite someone

1. Open **Admin**, choose **Organisation members** and find **Invite someone**.
2. Enter the person's Google account email and choose an **Organisation role**.
3. Add any narrower **Project roles** with **Add project role**.
4. Create the invitation, then copy its link and send it to the recipient.

The recipient accepts the invitation before using that access. Read the selected organisation role carefully: it applies across the organisation's projects.

## Roles and permissions

The organisation role choices start with **No role**, followed by Reader, Contributor, Maintainer and Owner.
No role gives no access to the organisation's projects. Choose it when someone should have access only
to specific projects, then assign those project roles. Each higher role includes the permissions below it.

| Role | What it can do |
|---|---|
| No role | Belong to the organisation without gaining project access. |
| Reader | Read a project's objects, relationships and branches, and approve a proposal. |
| Contributor | Edit objects and relationships, create branches, submit and refuse proposals, and merge where every matching branch rule is met. |
| Maintainer | Lock objects, publish types and views, and publish and administer hosted apps. |
| Owner | Create projects and manage their branch rules and agent permission ceiling, manage members, create service identities and credentials, configure the agent model, and allow reduced-isolation hosted apps. |

A person at **No role** belongs to the organisation and has no access until a project or organisation role is given. The members table and the invitation form say so beside that choice. Only organisation role pickers offer **No role**: the pickers for a project's roles list only the roles that give access, and start at the first of them.

You can give a role for the whole organisation or for one project. A role in the organisation reaches all of its projects. A role in a project applies to that project only. For example, if you are a Reader in the organisation and a Contributor in a project named Propulsion, you can read every project and edit objects only in Propulsion.

### Things a role doesn't give you

- Reading a project does not let you edit, merge, publish types or manage members.
- If an object in your project has a relationship with an object in another project, that relationship does not give you access to the other object's properties.

[Branches, rules and locks](https://docs.openeng.io/concepts/branches-and-rules.md) explains how branch rules add further limits.

### Give someone a role

An organisation Owner can give a person a role in the whole organisation or in one project:

1. Open **Admin** and choose **Organisation members**.
2. Under **Grant a role**, choose the **Member identity**.
3. Select the **Scope** and **Role**. Choose project scope if the role should apply to one project.
4. Choose **Grant role**.

The table shows each membership's scope and role. Select a different role in a row to change it,
or choose **Revoke** to remove another person's membership. Revoking an organisation membership
also removes that person's project memberships in the organisation and ends their work there.
You cannot grant a role above your own; equal-rank grants to another person are allowed.
You cannot grant yourself a membership or raise your own role. A person may lower their own role
through `changeMembershipRole` without permission to administer other members.

Every project member also belongs to its organisation. The picker lists identities already in the
organisation's member list; invite a person first. A new service identity belongs at **No role** and
can be granted a project role or have its organisation role changed. For example:

```sh
openeng admin-sdk createServiceIdentity --input '{"name":"Nightly importer"}'
openeng admin-sdk changeMembershipRole --input '{"principalId":"<principalId-from-create>","scopeKind":"organisation","scopeId":"<organisation-id>","roleKey":"<role-key>"}'
```

Use the returned principal ID, your organisation ID, and a role key: `none`, `reader`, `contributor`, `maintainer` or `owner`. The role-change command requires all four fields shown; an unknown role returns the available role keys. This action may ask you to confirm it in your browser.

The SDK and CLI equivalents for changing and revoking a membership are `changeMembershipRole` and `revokeMembership`:

```sh
openeng admin-sdk changeMembershipRole --input '{"principalId":"<principalId>","scopeKind":"organisation","scopeId":"<scopeId>","roleKey":"<role-key>"}'
openeng admin-sdk revokeMembership --input '{"principalId":"<principalId>","scopeKind":"organisation","scopeId":"<scopeId>"}'
```


## Leave a project or organisation

On a project's membership page, choose **Revoke** on your own row, then **Confirm removal** in
**Leave project**. You return to the organisation selector. On **Organisation members**, choose
**Leave organisation**, then **Confirm leave**. The write must succeed before the page leaves.

The SDK and CLI operation is `leaveMembership`. It accepts the scope alone, with no principal or
role; it always removes the signed-in person's membership:

```sh
openeng admin-sdk leaveMembership --input \
  '{"scopeKind":"project","scopeId":"<project-id>"}'
```

```ts
import type { AdminClient } from "@openengio/sdk/admin";

export async function leaveOrganisation(admin: AdminClient): Promise<void> {
  await admin.leaveMembership({
    input: { scopeKind: "organisation", scopeId: "<organisation-id>" },
  });
}
```

A membership is enough to leave, including a membership in an ended project. Leaving a project
removes its direct membership; an organisation role may still give you access there. Leaving an
organisation removes your memberships in its projects and ends your work there.

An organisation must retain at least one eligible administrator: an active, provisioned person
whose organisation role permits managing members. A suspended person or service identity does
not count. This is an organisation-wide check, not a requirement for a direct administrator in
every project. It applies to leaving, revoking and lowering the last administrator's role.

For SDK and CLI callers, the relevant refusals are:

| Refusal | Meaning |
|---|---|
| `no-such-membership` (OE006) | The visible scope holds no such membership. |
| `not-found` (OE067) | The scope is hidden or absent; both receive the same answer. |
| `last-administrator` (OE004) | The organisation would lose its last eligible administrator. |
| `membership-own-role` (P3608) | A person tried to grant themselves a membership or raise their own role. |

## When a name is not shown

Comments, attributions, subscribers and person fields show a person's name. Two labels stand in for
a name the page does not show:

- **Former member**: the person left the organisation, or was removed from it. No name, initial or
  identifier is shown.
- **Name not shown**: you cannot see that person, or the identifier names nobody. The two causes
  get the same label.
