1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-27 03:14:53 +09:00

C2S: When creating a resource, insert a Permit record

This commit is contained in:
Pere Lev 2023-12-07 18:50:44 +02:00
parent e2462627a5
commit 12e2284389
No known key found for this signature in database
GPG key ID: 5252C5C863E5E57D

View file

@ -360,6 +360,7 @@ clientAdd now personMeID (ClientMsg maybeCap localRecips remoteRecips fwdHosts a
-- Meaning: The human wants to create a ticket tracker -- Meaning: The human wants to create a ticket tracker
-- Behavior: -- Behavior:
-- * Create a deck on DB -- * Create a deck on DB
-- * Create a Permit record in DB
-- * Launch a deck actor -- * Launch a deck actor
-- * Record a FollowRequest in DB -- * Record a FollowRequest in DB
-- * Create and send Create and Follow to it -- * Create and send Create and Follow to it
@ -389,6 +390,14 @@ clientCreateDeck now personMeID (ClientMsg maybeCap localRecips remoteRecips fwd
(deckID, deckFollowerSetID) <- (deckID, deckFollowerSetID) <-
lift $ insertDeck now name msummary createID wid actorMeID lift $ insertDeck now name msummary createID wid actorMeID
-- Insert a Permit record
lift $ do
permitID <- insert $ Permit personMeID AP.RoleAdmin
topicID <- insert $ PermitTopicLocal permitID
insert_ $ PermitTopicDeck topicID deckID
insert_ $ PermitFulfillsTopicCreation permitID
insert_ $ PermitPersonGesture permitID createID
-- Insert the Create activity to my outbox -- Insert the Create activity to my outbox
deckHash <- encodeKeyHashid deckID deckHash <- encodeKeyHashid deckID
actionCreate <- prepareCreate name msummary deckHash actionCreate <- prepareCreate name msummary deckHash
@ -525,6 +534,7 @@ clientCreateDeck now personMeID (ClientMsg maybeCap localRecips remoteRecips fwd
-- Meaning: The human wants to create a project -- Meaning: The human wants to create a project
-- Behavior: -- Behavior:
-- * Create a project on DB -- * Create a project on DB
-- * Create a Permit record in DB
-- * Launch a project actor -- * Launch a project actor
-- * Record a FollowRequest in DB -- * Record a FollowRequest in DB
-- * Create and send Create and Follow to it -- * Create and send Create and Follow to it
@ -553,6 +563,13 @@ clientCreateProject now personMeID (ClientMsg maybeCap localRecips remoteRecips
(projectID, projectFollowerSetID) <- (projectID, projectFollowerSetID) <-
insertProject now name msummary createID actorMeID insertProject now name msummary createID actorMeID
-- Insert a Permit record
permitID <- insert $ Permit personMeID AP.RoleAdmin
topicID <- insert $ PermitTopicLocal permitID
insert_ $ PermitTopicProject topicID projectID
insert_ $ PermitFulfillsTopicCreation permitID
insert_ $ PermitPersonGesture permitID createID
-- Insert the Create activity to my outbox -- Insert the Create activity to my outbox
projectHash <- lift $ encodeKeyHashid projectID projectHash <- lift $ encodeKeyHashid projectID
actionCreate <- lift $ prepareCreate name msummary projectHash actionCreate <- lift $ prepareCreate name msummary projectHash
@ -682,6 +699,7 @@ clientCreateProject now personMeID (ClientMsg maybeCap localRecips remoteRecips
-- Meaning: The human wants to create a team -- Meaning: The human wants to create a team
-- Behavior: -- Behavior:
-- * Create a team on DB -- * Create a team on DB
-- * Create a Permit record in DB
-- * Launch a team actor -- * Launch a team actor
-- * Record a FollowRequest in DB -- * Record a FollowRequest in DB
-- * Create and send Create and Follow to it -- * Create and send Create and Follow to it
@ -710,6 +728,13 @@ clientCreateTeam now personMeID (ClientMsg maybeCap localRecips remoteRecips fwd
(groupID, projectFollowerSetID) <- (groupID, projectFollowerSetID) <-
insertTeam now name msummary createID actorMeID insertTeam now name msummary createID actorMeID
-- Insert a Permit record
permitID <- insert $ Permit personMeID AP.RoleAdmin
topicID <- insert $ PermitTopicLocal permitID
insert_ $ PermitTopicGroup topicID groupID
insert_ $ PermitFulfillsTopicCreation permitID
insert_ $ PermitPersonGesture permitID createID
-- Insert the Create activity to my outbox -- Insert the Create activity to my outbox
groupHash <- lift $ encodeKeyHashid groupID groupHash <- lift $ encodeKeyHashid groupID
actionCreate <- lift $ prepareCreate name msummary groupHash actionCreate <- lift $ prepareCreate name msummary groupHash