# Roles

> Named powers a game declares, who holds them by default, and how rooms and people hand them out.

A **role** is a named power a game checks before it lets someone do
something, such as `host` (start matches and set the teams) or `referee`.

Each role has a **default holder**:

| Default  | Who holds it                                          |
| -------- | ----------------------------------------------------- |
| Everyone | every player                                          |
| Owner    | the room owner                                        |
| Nobody   | no one, until the game, the room or a person gives it |

Who holds a role is decided in this order:

1. **Room code**, such as "admins are hosts".
2. **A person in the room**, in the Room management modal.
3. **The game itself**, while it runs.
4. The **default**.

Rooms have roles of their own too, such as Admin. Room roles are powers
over the room (kick, ban, options); games never see them.

The Menu and HUD use roles directly: a control can _require_ one, and
players without it see the control disabled. Rules can test them with
_{player} has {role}_.

In the Studio, roles live on the [Roles page](/studio/controls-and-roles).
In code, a game declares them with `game.role(...)`; see
[Roles and moderation](/rooms/roles-and-moderation) for how rooms decide.
