# Set up a team

> For the complete documentation index, see [llms.txt](https://docs-stg.ringleader.dev/llms.txt).


> Give a team its own namespace, admit its people, give them roles and limit what their workstations may name, as an organization administrator.


Give a team its own namespace, admit its people, give them roles and limit what their
workstations may name, as an organization administrator. You want this once Ringleader has
set up your organization and you are ready to bring a team onto it.

## Prerequisites

- Ringleader has created your organization, its domain claim (the OrgDomain) and your
  administrator access. [Organizations and domains](https://docs-stg.ringleader.dev/organizations-teams/accounts-access/organizations-domains/)
  says what Ringleader creates.
- You are signed in as an organization administrator, as
  [Sign in to your organization](https://docs-stg.ringleader.dev/guides/sign-in-organization/) shows.
- The examples use the organization `acmecorp`, the domain `acme.com`, a namespace named
  `acmecorp-team-a` and a person named `bob@acme.com`. Replace them with yours.

## Create a namespace

Create one namespace for the team, named as
[Namespace names](https://docs-stg.ringleader.dev/organizations-teams/accounts-access/namespaces-limits/#namespace-names)
says. Create it in your organization:

```bash
rl namespace create acmecorp-team-a --org acmecorp
```

## Admit people

Anyone whose email address is at your verified domain joins your organization on their first
sign-in, with no action from you. [Organization membership](https://docs-stg.ringleader.dev/organizations-teams/accounts-access/organizations-domains/#organization-membership)
says how people join.

1. Ask each person to sign in, as
   [Sign in to your organization](https://docs-stg.ringleader.dev/guides/sign-in-organization/) shows. For
   `bob@acme.com`, the sign-in matches `acme.com` and onboards him into `acmecorp`.
2. List your organization's members:

   ```bash
   rl user get
   ```

   The list includes `bob@acme.com`.

## Give someone a role

Put a person into the team's namespace with a role binding. The `namespace-member` role lets
them change their own workstations and nobody else's.
[Roles and grants](https://docs-stg.ringleader.dev/organizations-teams/accounts-access/roles-grants/)
lists the roles.

1. Save this as `bob-team-a.yaml`:

   ```yaml
   apiVersion: core.ringleader.dev/v1
   kind: RoleBinding
   metadata: { name: bob-team-a, namespace: acmecorp-team-a }
   spec:
     subjects: ["user:bob@acme.com"]
     roleRef: { kind: GlobalRole, name: namespace-member }
   ```

2. Apply the file:

   ```bash
   rl apply -f bob-team-a.yaml
   ```

## Write a policy

Limit what your organization's workstations may name with an OrgPolicy. This one allows git
repositories under `github.com/acme` and nothing else. Namespaces can narrow it and can't widen
it. [Namespace and organization policies](https://docs-stg.ringleader.dev/organizations-teams/policies-identities/policies/)
says how policies combine.

1. Save this as `acme-baseline.yaml`:

   ```yaml
   apiVersion: core.ringleader.dev/v1
   kind: OrgPolicy
   metadata:
     name: acme-baseline
   spec:
     org: acmecorp
     priority: 200
     rules:
       gitSources:
         default: deny
         allow:
           - github.com/acme
   ```

2. Apply the file:

   ```bash
   rl apply -f acme-baseline.yaml
   ```

3. List your organization's policies:

   ```bash
   rl orgpolicy get
   ```

   The list names `acme-baseline`. An apply that names a repository the policy denies is then
   refused, with a message that names the field and the value.

## Troubleshoot

- **If `rl namespace create` refuses the name or asks for `--org`,** see
  [Namespace names](https://docs-stg.ringleader.dev/organizations-teams/accounts-access/namespaces-limits/#namespace-names)
  and [Create a namespace](https://docs-stg.ringleader.dev/organizations-teams/accounts-access/namespaces-limits/#create-a-namespace).
- **If a person lands in a personal namespace instead of your organization,** see
  [Gates on auto-join](https://docs-stg.ringleader.dev/organizations-teams/accounts-access/organizations-domains/#gates-on-auto-join)
  and [Placement happens once](https://docs-stg.ringleader.dev/organizations-teams/accounts-access/organizations-domains/#placement-happens-once).

## Next steps

- [Cloud accounts](https://docs-stg.ringleader.dev/cloud-accounts/) connects your cloud to the organization.
- [Workstation and Secret sharing](https://docs-stg.ringleader.dev/organizations-teams/accounts-access/workstation-secret-sharing/)
  shares a workstation or a Secret with the team.
- [Storage buckets](https://docs-stg.ringleader.dev/cloud-accounts/storage-buckets/) sets where the team's
  uploads and session files are kept.

