<a id="manage-roles"></a>

# Manage roles

> Who: JIMM controller admin

> See also: [Role](https://documentation.ubuntu.com/jaas/latest/reference/role.md#role)

### Preview an example workflow

```text
# Create a role
juju add-role myrole

# Verify that the role has been created successfully:
juju list-roles

# Give the role admin access to a model:
juju add-permission role-model-admin#assignee administrator model-bob@canonical.com/foo

# Rename the role to better match its function:
juju rename-role model-admin

# Grant Alice access to the role
juju add-permission user-alice@canonical.com assignee role-model-admin

# Verify that Alice's access to the role has been granted successfully:
juju check-permission user-alice@canonical.com administrator model-bob@canonical.com/foo
```

<a id="add-a-role"></a>

## Add a role

To add a new role to your JIMM controller, use the `add-role` command followed by the name you want to assign to the role. For example:

```text
juju add-role model-admin
```

> See more: [juju add-role](https://documentation.ubuntu.com/jaas/latest/reference/jaas-plugin.md)

<a id="view-all-the-current-roles"></a>

## View all the current roles

To view all the current roles, run the `list-roles` command. For example:

```text
juju list-roles [options]
```

> See more: [juju list-roles](https://documentation.ubuntu.com/jaas/latest/reference/jaas-plugin.md)

<a id="assign-a-user-to-a-role"></a>

## Assign a user to a role

To assign a user to a role, add an `assignee` permission between the user and the role. For example:

```text
juju add-permission user-alice@canonical.com assignee role-myrole
juju add-permission group-mygroup#member assignee role-myrole
juju add-permission user-everyone@external assignee role-my-role
```

> See more: [Manage permissions](https://documentation.ubuntu.com/jaas/latest/howto/manage-permissions.md#manage-permissions)

<a id="rename-a-role"></a>

## Rename a role

To rename a role, run the `rename-role` command followed by the old name and the new name. For example:

```text
juju rename-role model-admin model-writer
```

> See more: [juju rename-role](https://documentation.ubuntu.com/jaas/latest/reference/jaas-plugin.md)

<a id="remove-a-role"></a>

## Remove a role

To remove a role from a JIMM controller, run the `remove-role` command followed by the name of the role. For example:

```text
juju remove-role model-admin
```

> See more: [juju remove-role](https://documentation.ubuntu.com/jaas/latest/reference/jaas-plugin.md)
