Skip to main content

Module people

Module people 

Source
Expand description

Who works in the app: people (a name, and optionally an affiliation and an ORCID iD), the one working now, or a guest. What a person does is recorded under their name (the activity log, an app’s own records such as a curation log), so the name may end up in files that are shared: a guest leaves no name (guest).

No passwords: this names who did what on one computer; servers keep their own pairing. The people are kept in a file the app names (load), JSON, read and written whole; in a browser, where there is no file, for the page’s life.

Structs§

Person
One person.

Constants§

GUEST
What a guest is recorded as.

Functions§

add
Adds person (trimmed), working now when use_now. A name already taken is refused.
current
The person working now; None: a guest.
generation
Bumped on every change (redraw when it moves).
load
Reads the people from path (none yet: no one, a guest working) and keeps them there. Returns a notice when the file could not be read (it is then left as it is until a change).
orcid_ok
0000-0000-0000-000X: four groups of four digits, the last character a digit or X, with the ISO 7064 11-2 check digit right.
people
Everyone, in the order added.
remove
Forgets name (working now: a guest works then). What was recorded under the name stays.
use_person
name works now (None: a guest). An unknown name is refused.
who
The name things are recorded under now: the person’s, or GUEST.