# People & Groups

An **actor** is anyone or anything that can own content, be given access to it, or make a change. Every piece of content records who created it, and every change records who made it.

## Five kinds of actor

| Actor | Who it is | Can create and change content? |
|---|---|---|
| `USER` | A person with an OnEarly account. | Yes |
| `GROUP` | A care team, family, organisation or other group of people. Content a group owns stays with the group, even as members come and go. | Yes, through members allowed to act for it |
| `AGENT` | Your OnEarly Agent. Each person has their own. | Yes, within the access you give it (see below) |
| `SYSTEM` | OnEarly itself. Carries out platform processes. | Yes |
| `PUBLIC` | Everyone, including people who are not signed in. | No — the public can only be given access, never make changes |

## Author and subject

Content records two different actors:

- the **author** — who created it and owns it
- the **subject** — who it is about

They are often different. When a clinic records a result for a patient, the clinic is the author and the patient is the subject.

## Acting as yourself or as a group

When you make a change you act in one of three ways. The way you act decides whose name the change is recorded under, and what is checked.

| Acting as | Recorded as | Your identity |
|---|---|---|
| `USER` | You, personally | Shown |
| `GROUP` | The group | Not shown — the change is the group's |
| `GROUP_MEMBER` | You, as a member of a named group | Shown, together with the group |

- Signed in to the app, you act as yourself by default.
- Acting as a group needs permission from the group (see [Group roles](#group-roles)). Posting as a group in threads is on the roadmap; see [Threads with other people](../roadmap/in-progress.md#threads-with-other-people).
- Requests made with a group's API key act as the group.

:::tip[Best practice]
[Connecting apps when you belong to several groups](../best-practices/connecting-apps-across-groups.md)
:::

## Your OnEarly Agent

Your OnEarly Agent is an actor in its own right, so its work is never confused with yours.

- It works only within your access. It cannot see or change anything you can't, and it never acts for another person.
- It asks before changing your content. Changes to content you own happen only after you approve them on an approval card; once you approve, the change is made as you. Content the agent owns, such as a log you ask it to keep, it can write straight away.
- Shares and invitations are shown on an approve or reject card first, unless you have already told it exactly what to do. See [Approvals before it acts for you](../features/onearly-agent.md#approvals-before-it-acts-for-you) for every rule.
- The permissions your agent holds for you can be narrowed or revoked.

## Groups

Groups bring people together around shared information: care teams, families, organisations and programs.

### Visibility

| Visibility | Can people find it? | How people join |
|---|---|---|
| `PUBLIC` | Yes | Anyone can join |
| `PRIVATE` | Yes | By invitation |
| `SECRET` | No — only members know it exists | By invitation |

### Invitations

People join private and secret groups by invitation, including through an invite link. An invitation is `PENDING`, `ACCEPTED`, `DECLINED`, `EXPIRED` or `REVOKED`.

### Group roles

Each member holds one or more roles. A role is a set of group permissions.

| Role | Permissions | Can it be changed? |
|---|---|---|
| **Admin** | Every group permission | No |
| **Member** | View the group | Yes — a group can add to it |

Groups can also define their own roles. The names Admin and Member are reserved.

### Group permissions

| Permission | Allows |
|---|---|
| `view-group` | See the group. |
| `manage-group` | Change group settings and publish members' posts to the group. |
| `view-group-members` | See the member list. |
| `manage-group-members` | Manage members and their roles. |
| `view-group-member-count` | See how many members the group has. |
| `view-group-member-names` | See members' names. |
| `view-group-member-emails` | See members' email addresses. |
| `act-as-group:view-as-group` | See content shared with the group, as the group. |
| `act-as-group:manage-group-content` | Create and change content as the group. |
| `create-sub-group` | Create sub-groups under the group. Sub-groups are [on the roadmap](../roadmap/in-progress.md#sub-groups). |

When a group is created, the Member role can be given only `view-group-member-count` and `view-group-member-names` on top of `view-group`. Email addresses and the right to act as the group are never added to Member at creation.

:::note[Membership and content are separate]
Joining a group does not give you access to any content by itself. Content becomes visible to members only when it is shared with the group. See [Permissions & Roles](permissions.md).
:::

Source: https://docs.onearly.com/core-model/actors/
