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) <-
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
factoryHash <- encodeKeyHashid factoryMeID
let sieve =

View file

@ -531,7 +531,10 @@ clientCreateFactory now personMeID (ClientMsg maybeCap localRecips remoteRecips
Entity aid a <- insertActor now name (fromMaybe "" msummary) (Left (LocalActorPerson personMeID, actorMeID, obiidCreate))
rid <- insert $ Resource aid
fid <- insert Factory
{ factoryResource = rid
{ factoryResource = rid
, factoryAllowDeck = True
, factoryAllowProject = True
, factoryAllowTeam = True
}
return (fid, rid, actorFollowers a)

View file

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

View file

@ -182,7 +182,10 @@ Komponent
UniqueKomponent resource
Factory
resource ResourceId
resource ResourceId
allowDeck Bool
allowProject Bool
allowTeam Bool
UniqueFactory resource