- types:
- a set of
Files - a set of
Tokens
- a set of
- concepts:
- one
Trash[File]namedT - one
Permalink[File,Token]namedP
- one
- invariants:
- a
Filehas aTokenin itsurlsthat can still be accessed iff thatTokenwas shared when theFilewasaccessible, and theTokenhas not beenaccessedin the meantime, nor theFilehas been permanently deleted. - a token is in
accessediff it was accessed while the corresponding file was accessible.
- a
- views:
uploaded= the set ofFiles that have been createdshared= the set ofTokens that have been shared for eachFileand not yet revoked
- reactions:
reaction empty_revoke
when
T.empty[]
where
f in T.trashed and t in f.shared
then
P.revoke[t]
reaction access_revoke
when
P.access[t]
then
P.revoke[t]
reaction share_error
when
P.share[f,t]
where
f not in uploaded
then
error
reaction revoke_error
when
P.revoke[t]
where
t not in P.accessed and shared.t in uploaded
then
error
reaction access_error
when
P.access[t]
where
shared.t in T.trashed
then
error
- formalizations: Alloy