STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
stardesign.admins Namespace Reference

Functions

set[str] admin_slugs ()
bool is_admin (Request request, UserData ud)

Variables

tuple ADMIN_EMAILS

Detailed Description

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``).

Function Documentation

◆ admin_slugs()

set[str] stardesign.admins.admin_slugs ( )

Definition at line 33 of file admins.py.

Referenced by is_admin().

◆ 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().

Variable Documentation

◆ ADMIN_EMAILS

tuple stardesign.admins.ADMIN_EMAILS
Initial value:
1= (
2 "aahilsyed72@berkeley.edu",
3 "carlosbautista@berkeley.edu",
4 "aidanrickert@berkeley.edu",
5 "manank_doshi@berkeley.edu",
6)

Definition at line 25 of file admins.py.