User Resource

A Django User represents an individual user account within the Smarter platform, related to an Account. Users have specific roles and permissions.

Example User Manifest
apiVersion: smarter.sh/v1
kind: User
metadata:
  description: an example user manifest for the Smarter API User
  name: example_user
  username: example_user
  version: 1.0.0
spec:
  config:
    email: joe@mail.com
    firstName: John
    isActive: true
    isStaff: false
    lastName: Doe

A user belongs to the account of whoever applies their manifest. In an organization of several accounts, such as a company and its departments (see Account), spec.accounts lists the accounts that the user belongs to instead, and whether they administer each one:

spec:
  config:
    email: cfo@example.com
    firstName: Avery
    lastName: Example
    isActive: true
  accounts:
    - accountNumber: "2718-2818-0002" # Accounting, which they administer
      isAccountAdmin: true
    - accountNumber: "2718-2818-0003" # HR, as a member
    - accountNumber: "2718-2818-0004" # Content, as a member

Applying the manifest adds each membership that is missing and updates the others. It never removes one, because removing a user from an account would delete everything that they own there. A superuser may list any account; an account’s administrator may list only the accounts that they administer.

A manifest never holds a password. spec.config.passwordSecret names a Secret instead, whose value becomes the user’s password each time the manifest is applied, e.g. the published password of the demonstration users of the Stackademy example project. Only a superuser may set it.

Technical References