---
url: /en/docs/additions/users.md
description: >-
  Add users to Sveltia CMS Additions with admin, editor or viewer roles. They
  can sign in with a password, so no GitHub account is needed, or with GitHub.
---

# Users and Roles

With [Sveltia CMS Additions](/en/docs/additions), people sign in to the CMS with an account the service manages, rather than with their own GitHub account. Admins add people in the **Users** section of the [Administration page](/en/docs/additions/administration) and give each a role.

## Roles

Each user has one of three roles:

| Role   | What they can do                                                                    |
| ------ | ----------------------------------------------------------------------------------- |
| Admin  | Everything an editor can, plus manage users and settings on the Administration page |
| Editor | Create, edit, delete and publish content and assets, and trigger deployments        |
| Viewer | Browse content and assets, and comment on entries, without changing anything        |

For a viewer, the whole CMS is read-only, as if the global [`readonly` option](/en/docs/collections/entries/operations#making-content-read-only) were set, with a message saying they have view-only access. They can’t trigger deployments, and they never take [entry locks](/en/docs/additions/collaboration#entry-locks), but they can still use the [Conversation panel](/en/docs/additions/collaboration#conversation-panel).

The role is enforced by GitHub as well as by the CMS: the token a viewer gets can only read the repository, while an editor’s or an admin’s can write to it. Either way, the token is limited to the site’s repository.

There must always be at least one admin, and admins can’t disable or delete their own account.

### Changing a Role

Select **Edit User** in the options menu of the user’s row, and choose a new role. Demoting someone takes effect at once: their GitHub tokens are revoked on GitHub, and their open CMS tabs switch to the new role the next time the CMS calls GitHub. Unsaved changes stay in the local draft backup.

A promotion takes effect when the CMS next renews its GitHub token, which happens within an hour, or straight away if the user signs in again.

## Adding Users

In the **Users** section, select **Add User** and enter:

* **Username:** 3 to 30 lowercase letters, digits, dots, hyphens or underscores, used to sign in. It can’t be changed later.
* **Name:** shown in the CMS, e.g. on [entry locks](/en/docs/additions/collaboration#entry-locks) and comments, and used as the [commit author](/en/docs/additions/administration#commit-author).
* **Email:** optional. It’s used as the commit author’s email, so GitHub can link commits to the person’s GitHub profile.
* **Role:** admin, editor or viewer.
* **GitHub username:** optional. With one, the person [signs in with that GitHub account](#signing-in-with-github) instead of a password.

Without a GitHub username, the CMS shows the username and a temporary password once, each with a button to copy it. Give them to the person, who chooses their own password the first time they sign in. Passwords must have at least 12 characters.

If the person has an email address, **Email to** opens your email app with a message ready to send: their username, the temporary password and a link that opens the CMS with both filled in on the sign-in form. The details are taken out of the address as soon as the CMS reads them, and the person still signs in and chooses their own password. **Reset Password** offers the same button, with a message saying the password has been reset.

Sveltia CMS Additions never sends email itself, so there are no automatic invitations or password reset emails: admins hand out temporary passwords, from their own email app or otherwise.

### Managing Users

The users list shows each person’s role, how they sign in, when they last signed in and their status:

* **Active:** can sign in.
* **Temporary password:** hasn’t chosen their own password yet.
* **Waiting for first sign-in:** was added with a GitHub username, and hasn’t signed in yet.
* **Disabled:** can’t sign in.

The options menu in each row lets you:

* **Edit User:** changes the user’s name, email, role and, when GitHub sign-in is on, GitHub username. The username can’t be changed. The GitHub username of someone who can only sign in with GitHub can’t be removed until they have a password, which **Reset Password** gives them.
* **Reset Password:** gives the user a new temporary password and signs them out everywhere.
* **Sign Out Everywhere:** ends all their sessions.
* **Disable User** and **Enable User:** turns sign-in off or on for the account. Disabling signs them out and revokes their GitHub tokens.
* **Delete User:** removes the account. This can’t be undone. Their comments stay, attributed to a deleted user.

To remove someone who could sign up again through a [sign-up rule](#sign-up-rules), disable their account rather than delete it: a deleted account would be created again the next time they sign in.

## Signing In

The sign-in page shows a username and password form, and a **Sign In with GitHub** button when GitHub sign-in is turned on.

Sessions end after a day without use, and after 7 days in any case. The CMS renews the GitHub token in the background while the session lasts, so nobody has to sign in again in the middle of their work. Repeated failed sign-ins are rate limited.

### Your Account

Open **Settings** from the account menu, at the top right, or from the **Menu** page on a small screen, and select the **Account** tab. There you can change your name, which is also used as the author of your commits. Your username can’t be changed, and only an admin can change your email address, so nobody can make their commits look like someone else’s.

To change your password, enter your current password and a new one in the **Password** section. You stay signed in on that device, and are signed out everywhere else.

Passwords never leave the browser: the CMS derives a hash from the password before sending it, so the service never sees it.

### Signing In with GitHub

An admin can turn on GitHub sign-in in the [**Sign-In**](/en/docs/additions/administration#sign-in) section of the Administration page. People who sign in with GitHub get a token for their own GitHub account, so their changes are committed as them, and their access to the repository is what GitHub allows them.

GitHub sign-in never creates an account by itself. Someone can only sign in with GitHub if an admin has added them with their GitHub username, or if a [sign-up rule](#sign-up-rules) covers them. The account is tied to the GitHub user ID, so it keeps working if the person renames their GitHub account.

People with a password account can also select **Link GitHub Account** in the account menu to sign in with GitHub from then on.

### Sign-Up Rules

By default, only admins add people. A sign-up rule lets the members of a GitHub organization sign in with GitHub without being added first. Add rules in the [**Sign-In**](/en/docs/additions/administration#sign-in) section of the Administration page. How they work:

* The GitHub App must be installed on that organization.
* A rule gives new accounts the editor or viewer role, never admin. Promote people by hand when needed.
* The person is checked against the rule every time they sign in with GitHub, and at least once an hour while they keep using the CMS. Someone who has left the organization is turned away or signed out, and their account is disabled.
* If GitHub can’t tell, e.g. while it’s down or after the organization has been renamed, the sign-in fails, but the account stays as it is.

An account created by a rule shows an **Adopt Account** option. Adopting it turns it into an ordinary account, which no longer depends on the rule. Promoting someone to admin adopts their account too.

## Commits

People who sign in with GitHub, or have linked their GitHub account, commit as themselves.

Everyone else saves through the site’s GitHub App, which can either commit in the person’s name, or as the app with the person as co-author. Admins choose in the [Commit Author](/en/docs/additions/administration#commit-author) setting.
