|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Functions | |
| set[str] | admin_slugs () |
| bool | is_admin (Request request, UserData ud) |
Variables | |
| tuple | ADMIN_EMAILS |
Who is an admin: a fixed list, checked against the caller's identity. Admins may choose the team's main design and are the only ones who may change it (see :mod:`stardesign.documents`). The list is in code on purpose: changing who can rewrite the main design should be a reviewed commit, not a button. Identity is the ``X-Auth-Email`` Caddy sets after verifying the session, and Caddy strips any copy the client sent (see deploy/caddy/Caddyfile), so the comparison below is against an email the caller cannot choose. ``STAR_ADMINS`` (comma-separated emails) adds to the list without a commit. It exists for dev, where there is no Caddy and every request is the ``local`` user (``STAR_ADMINS=local``).
| set[str] stardesign.admins.admin_slugs | ( | ) |
Definition at line 33 of file admins.py.
Referenced by is_admin().
| bool stardesign.admins.is_admin | ( | Request | request, |
| UserData | ud ) |
Whether the caller is a STAR admin.
Definition at line 38 of file admins.py.
References admin_slugs().