Vervis/migrations/564_2023-11-22_permit.model
Pere Lev 05d3a1eaef
DB: Tables for the person side of Collabs (i.e. direct-Grants they got)
Until now I've managed to avoid having to implement this piece quite
easily. The only temptation to implement it has been pseudo-client
features, which are basically just a workaround until Vervis gets a
separate client app.

But now, Person actors need to be able to automatically send
delegator-Grants when they receive a direct-Grant from a resource they
either asked to Join or got an Invite to. So, this creates a need to
track these joins and invites on the server side.

I'm not checking the exact minimal pieces necessary for
delegator-Grants. Instead, I'm starting a full implementation of the
person-side of Collab records (AKA direct-Grants), called Permit
records. This will also allow very convenient display of these Grants
and the extensions received through them, as well as UI buttons such as
accepting/rejecting a received Join or Invite.
2023-11-22 18:11:07 +02:00

182 lines
4.7 KiB
Text

Permit
person PersonId
role Role
-------------------------------- Permit topic --------------------------------
PermitTopicLocal
permit PermitId
UniquePermitTopicLocal permit
PermitTopicRepo
permit PermitTopicLocalId
repo RepoId
UniquePermitTopicRepo permit
PermitTopicDeck
permit PermitTopicLocalId
deck DeckId
UniquePermitTopicDeck permit
PermitTopicLoom
permit PermitTopicLocalId
loom LoomId
UniquePermitTopicLoom permit
PermitTopicProject
permit PermitTopicLocalId
project ProjectId
UniquePermitTopicProject permit
PermitTopicGroup
permit PermitTopicLocalId
group GroupId
UniquePermitTopicGroup permit
PermitTopicRemote
permit PermitId
actor RemoteActorId
UniquePermitTopicRemote permit
------------------------------- Permit reason --------------------------------
PermitFulfillsTopicCreation
permit PermitId
UniquePermitFulfillsTopicCreation permit
PermitFulfillsInvite
permit PermitId
UniquePermitFulfillsInvite permit
PermitFulfillsJoin
permit PermitId
UniquePermitFulfillsJoin permit
-- Person's gesture
--
-- Join: Witnesses the initial Join that started the sequence
-- Invite: Witnesses their approval, seeing the topic's accept, and then
-- sending their own accept
-- Create: Records the Create activity that created the topic
PermitPersonGesture
permit PermitId
activity OutboxItemId
UniquePermitPersonGesture permit
UniquePermitPersonGestureActivity activity
-- Topic collaborator's gesture
--
-- Join: N/A (it happens but we don't record it)
-- Invite: Witnesses the initial Invite that started the sequence
PermitTopicGestureLocal
fulfills PermitFulfillsInviteId
invite OutboxItemId
UniquePermitTopicGestureLocal fulfills
UniquePermitTopicGestureLocalInvite invite
PermitTopicGestureRemote
fulfills PermitFulfillsInviteId
actor RemoteActorId
invite RemoteActivityId
UniquePermitTopicGestureRemote fulfills
UniquePermitTopicGestureRemoteInvite invite
-- Topic's accept
--
-- Join: N/A
-- Invite: Witnesses that the topic saw and approved the Invite
PermitTopicAcceptLocal
fulfills PermitFulfillsInviteId
topic PermitTopicLocalId
accept OutboxItemId
UniquePermitTopicAcceptLocal fulfills
UniquePermitTopicAcceptLocalTopic topic
UniquePermitTopicAcceptLocalAccept accept
PermitTopicAcceptRemote
fulfills PermitFulfillsInviteId
topic PermitTopicRemoteId
accept RemoteActivityId
UniquePermitTopicAcceptRemote fulfills
UniquePermitTopicAcceptRemoteTopic topic
UniquePermitTopicAcceptRemoteAccept accept
-------------------------------- Permit enable -------------------------------
-- Topic's grant
--
-- Join: Seeing the new-collaborator's Join and existing-collaborator's Accept,
-- the topic has made the link official and sent a direct-grant
-- Invite: Seeing existing-collaborator's Invite and new-collaborator's Accept,
-- the topic has made the link official and sent a direct-grant
PermitTopicEnableLocal
permit PermitPersonGestureId
topic PermitTopicLocalId
grant OutboxItemId
UniquePermitTopicEnableLocal permit
UniquePermitTopicEnableLocalTopic topic
UniquePermitTopicEnableLocalGrant grant
PermitTopicEnableRemote
permit PermitPersonGestureId
topic PermitTopicRemoteId
grant RemoteActivityId
UniquePermitTopicEnableRemote permit
UniquePermitTopicEnableRemoteTopic topic
UniquePermitTopicEnableRemoteGrant grant
----------------------- Permit delegator+extension ---------------------------
-- This section is only for Project or Team topics
-- Person sends delegator-Grant, topic starts sending extension-Grants
-- Witnesses that the person used the direct-Grant to send a delegator-Grant to
-- the topic
PermitPersonSendDelegator
permit PermitPersonGestureId
grant OutboxItemId
UniquePermitPersonSendDelegator permit
UniquePermitPersonSendDelegatorGrant grant
-- Witnesses extension-Grants that the topic has sent, extending chains from
-- its components/subprojects or projects/superteams
PermitTopicExtendLocal
permit PermitPersonSendDelegatorId
topic PermitTopicEnableLocalId
grant OutboxItemId
UniquePermitTopicExtendLocal permit
UniquePermitTopicExtendLocalTopic topic
UniquePermitTopicExtendLocalGrant grant
PermitTopicExtendRemote
permit PermitPersonSendDelegatorId
topic PermitTopicEnableRemoteId
grant RemoteActivityId
UniquePermitTopicExtendRemote permit
UniquePermitTopicExtendRemoteTopic topic
UniquePermitTopicExtendRemoteGrant grant