# Principals and policies

Members, IAM users, groups and roles, and how the policies attached to them add up to what a principal may do.

A **principal** is what a request acts as. In Deutsche Cloud that is always an IAM user: a member's,
one you create, or the temporary user a role session acts as. Permissions are policies attached to
principals. The one exception is an Object Storage bucket policy, which is attached to a bucket.

## Members and their IAM users

A **member** is a person who signs in with their own email address. Each member has an
organization role, shown on **Settings** → **Members**:

| Role      | Starter policy        | What the console says it grants                               |
| --------- | --------------------- | ------------------------------------------------------------- |
| `owner`   | `AdministratorAccess` | Everything, including members, policies and billing           |
| `admin`   | `PowerUserAccess`     | Full access to every service except IAM and billing ownership |
| `member`  | `DeveloperAccess`     | Create and manage resources, no access to IAM or billing      |
| `viewer`  | `ReadOnlyAccess`      | Read-only view of all resources                               |
| `billing` | `BillingFullAccess`   | Invoices, payment methods and usage only                      |
| `none`    | none                  | Joins the organization with no permissions                    |

The owner gets `AdministratorAccess` when the organization is created. For everyone else the role
picks the starter policy when the person joins by invitation or by a first single sign-on. After that, what a member may do is whatever their IAM user's policies say: changing the
role on **Members** attaches or detaches nothing. The owner's role cannot be changed, and the
owner cannot be removed.

Every member has an IAM user whose user name is derived from their email address; the owner's is
called `owner`. A person who leaves keeps their IAM user, marked as a former member, with its
access keys and console password switched off.

## IAM users you create

| Type                | Signs in                                                                                         |
| ------------------- | ------------------------------------------------------------------------------------------------ |
| **User**            | With an access key, and to the console with a password you give it on its **Console access** tab |
| **Service account** | With an access key only, never to the console                                                    |

The type is chosen at creation and cannot be changed. A new IAM user holds no permissions until
you attach a policy, add it to a group or assign it a role.

## Groups and roles

- A **group** is a set of IAM users. Every member of the group holds every policy attached to it.
  Groups cannot contain groups.
- A **role** is a set of policies. Assigned to an IAM user, it gives that user the role's
  policies. A role with a trust policy can also be assumed by a workload with an OIDC token; see
  [Web identity federation](web-identity-federation.md).

## How the policies add up

An IAM user's policies are the union of three sources:

1. Policies attached to the user directly.
2. Policies attached to every group the user is in.
3. Policies attached to every role assigned to the user.

The union is evaluated as one set: an explicit `Deny` in any of them wins over every `Allow`; see
[How a request is decided](how-a-request-is-decided.md). A role session (a workload that assumed a
role) holds exactly the role's policies and nothing else.

An IAM user whose status is inactive cannot sign in or use its access keys, whatever its policies
say.

## Related

- [Policy documents](policy-documents.md)
- [Managed policies and preset roles](managed-policies-and-preset-roles.md)
- [Invite a person](invite-a-person.md)
- [Create an IAM user](create-an-iam-user.md)
