---
title: Sharing and roles
description: Decide who can open an app and what they can do: specific people, everyone at your company, anyone who signs in with the link, or anyone with the link.
---

A new app is private: only you can open it. You open it up in four independent ways, and each person gets the **highest** role any of them gives them.

| Way | Who it reaches | Roles you can give |
|---|---|---|
| **People** | Specific email addresses. Shed can email them an invite. | viewer, editor, owner |
| **Your company** | Everyone who signs in with an address at your company's email domain. | viewer, editor |
| **Anyone signed in with the link** | Anyone who has the link and signs in, optionally only at one domain. | viewer, editor |
| **Anyone with the link** | Anyone, signed in or not. | viewer, editor |

## Roles

| Role | Open the app and read its data | Add, change and delete data | Deploy, share, roll back |
|---|---|---|---|
| viewer | ✓ | | |
| editor | ✓ | ✓ | |
| owner | ✓ | ✓ | ✓ |

Whoever creates an app is its owner for good, and is the only person who can delete it. Shed checks the role on every request, so a change takes effect on the person's very next click.

:::tip
Give **edit access to people, not links**. An editor can change any record in the app, so "anyone with the link can edit" means anyone who ever sees the link.
:::

## Share with people

```sh
$ npx shedcloud share standup --add sam@example.com --invite          # viewer, and email them
$ npx shedcloud share standup --add lee@example.com:editor --invite
$ npx shedcloud share standup --add ana@example.com:owner
$ npx shedcloud share standup --remove sam@example.com
```

Or open your dashboard, choose **Manage** next to the app, and add people there. New people start as viewers unless you pick another role.

**`--invite` emails each person a link** from Shed, naming you and the app. The link signs them in as that address and opens the app after one click; it works once, for 7 days. The dashboard sends one by default (untick **Email them an invite** to skip it). You can send up to 50 invites a day.

Without `--invite`, the command prints a message for you to send instead. When the person opens the link, Shed asks for their email and sends them a sign-in link; they must use the address you shared with. People you share with can always sign in, even on a Shed that only lets some people publish.

## Share with your company

```sh
$ npx shedcloud share standup --org viewer
```

Everyone signing in with an address at your company's domain gets that role. Set `--org none` to turn it off.

- **On a self-hosted Shed** with a company domain (the `SHED_ORG_DOMAIN` setting), the domain is that one, and the app also shows up in those people's app lists.
- **On Shed Cloud**, the domain is the app creator's own: if you signed up as `pam@startup.com`, `--org editor` lets in anyone who signs in with an `@startup.com` address. It's the same as `--signed-in editor --domain startup.com`. Personal domains such as gmail.com are refused, since anyone can get an address there.

The command prints a message to post to your team.

## Share with anyone who signs in with the link

```sh
$ npx shedcloud share standup --signed-in editor
```

Anyone who opens the link and signs in with their email gets that role, so you can send a team a link without collecting addresses first. Unlike public access, every person is known: `shed.me()` returns their email and their records show who wrote them. On an invite-only Shed, people who aren't on the list can still sign in through such a link, but only to open that app.

A forwarded link works for whoever receives it. To keep it to one company, add a domain:

```sh
$ npx shedcloud share standup --signed-in editor --domain startup.com
```

Now only addresses ending in `@startup.com` get in. `--domain ""` removes the limit. The command prints a message to post to your team.

## Share with anyone who has the link

```sh
$ npx shedcloud share standup --public viewer
```

Visitors don't need to sign in. In the page, `shed.me()` returns `user: null` for them, and anything an anonymous editor writes is recorded as written by nobody (`_meta.created_by` is `null`).

:::warning
`--public editor` lets anyone with the link change the app's data without signing in. Shed asks you to confirm in the dashboard, and the CLI prints a warning with the command that undoes it.
:::

## Owners outside your company

You can make anyone an owner, but an owner can deploy new code, change sharing and delete data. When the email isn't on your company domain, the dashboard asks you to confirm, and the CLI prints a warning with the undo command.

## Check who has access

```sh
$ npx shedcloud info standup
standup (standup)  https://standup.shed.example.com/
  owner: ana@example.com   your role: owner   records: 42
  access: your org can view, plus people you add
  member: sam@example.com (viewer)
  member: lee@example.com (editor)
```

Anyone who can open an app can run `info` on it. In the dashboard, the **Who can open it** column sums it up, and the share panel lists everyone.

## Show people what they can do

Your page should hide controls the person's role can't use, and say who to ask:

```js
const { app } = await shed.me();
if (await shed.can('edit')) showForm();
else showNote(`To add your own, ask ${app.owner} for edit access.`);
```

The server refuses a viewer's writes either way. See the [SDK reference](sdk.md#shed-can-action).
