DB, S2S: Factory: Record set of allowed types

This commit is contained in:
Pere Lev 2024-08-06 15:37:49 +03:00
parent 18bcfb88f2
commit df4a2b221e
No known key found for this signature in database
GPG key ID: 5252C5C863E5E57D
4 changed files with 21 additions and 2 deletions

View file

@ -138,6 +138,13 @@ factoryCreateNew new now factoryMeID (Verse authorIdMsig body) detail = do
(newLocalResource, launchNewActor, sendInit, newResourceID) <- (newLocalResource, launchNewActor, sendInit, newResourceID) <-
insertNewActor now name msummary createDB actorMeID insertNewActor now name msummary createDB actorMeID
-- Verify this actor type is enabled
let allow NADeck = factoryAllowDeck
allow NAProject = factoryAllowProject
allow NATeam = factoryAllowTeam
unless (allow new factoryMe) $
throwE "I don't support this actor type"
-- Prepare forwarding the Create to my followers -- Prepare forwarding the Create to my followers
factoryHash <- encodeKeyHashid factoryMeID factoryHash <- encodeKeyHashid factoryMeID
let sieve = let sieve =

View file

@ -532,6 +532,9 @@ clientCreateFactory now personMeID (ClientMsg maybeCap localRecips remoteRecips
rid <- insert $ Resource aid rid <- insert $ Resource aid
fid <- insert Factory fid <- insert Factory
{ factoryResource = rid { factoryResource = rid
, factoryAllowDeck = True
, factoryAllowProject = True
, factoryAllowTeam = True
} }
return (fid, rid, actorFollowers a) return (fid, rid, actorFollowers a)

View file

@ -3926,6 +3926,12 @@ changes hLocal ctx =
, removeField "Group" "create" , removeField "Group" "create"
-- 664 -- 664
, removeField "Factory" "create" , removeField "Factory" "create"
-- 665
, addFieldPrimRequired "Factory" True "allowDeck"
-- 666
, addFieldPrimRequired "Factory" True "allowProject"
-- 667
, addFieldPrimRequired "Factory" True "allowTeam"
] ]
migrateDB migrateDB

View file

@ -183,6 +183,9 @@ Komponent
Factory Factory
resource ResourceId resource ResourceId
allowDeck Bool
allowProject Bool
allowTeam Bool
UniqueFactory resource UniqueFactory resource