feat: Require scopeId on domain tables to ensure user isolation (#73)
This commit is contained in:
parent
4f2e6b3210
commit
84cfbadc45
40 changed files with 4258 additions and 770 deletions
|
|
@ -0,0 +1,6 @@
|
|||
analyzer:
|
||||
errors:
|
||||
camel_case_types: ignore
|
||||
|
||||
formatter:
|
||||
trailing_commas: preserve
|
||||
|
|
@ -8,7 +8,7 @@ environment:
|
|||
resolution: workspace
|
||||
|
||||
dependencies:
|
||||
serverpod_client: 3.5.0-beta.9
|
||||
serverpod_database: 3.5.0-beta.9
|
||||
serverpod_client: 3.5.0-beta.10
|
||||
serverpod_database: 3.5.0-beta.10
|
||||
serverpod_offline_sync_client:
|
||||
path: ../../packages/serverpod_offline_sync_client
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ table: address
|
|||
database: all
|
||||
fields:
|
||||
id: UuidValue?, defaultPersist=random_v7
|
||||
### Owner scope of this row. Maintained by the CRDT sync layer.
|
||||
scopeId: int?
|
||||
street: String
|
||||
inhabitantId: UuidValue?, unique
|
||||
inhabitant: Person?, relation(name=person_address, field=inhabitantId, onDelete=Restrict)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ table: city
|
|||
database: all
|
||||
fields:
|
||||
id: UuidValue?, defaultPersist=random_v7
|
||||
### Owner scope of this row. Maintained by the CRDT sync layer.
|
||||
scopeId: int?
|
||||
name: String
|
||||
citizens: List<Person>?, relation
|
||||
organizations: List<Organization>?, relation(name=city_org)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ table: company
|
|||
database: all
|
||||
fields:
|
||||
id: UuidValue?, defaultPersist=random_v7
|
||||
### Owner scope of this row. Maintained by the CRDT sync layer.
|
||||
scopeId: int?
|
||||
name: String
|
||||
town: Town?, relation(field=townId, onDelete=SetDefault)
|
||||
townId: UuidValue, default='550e8400-e29b-41d4-a716-446655440000'
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ table: fk_chain_cascade_middle
|
|||
database: all
|
||||
fields:
|
||||
id: UuidValue?, defaultPersist=random_v7
|
||||
### Owner scope of this row. Maintained by the CRDT sync layer.
|
||||
scopeId: int?
|
||||
name: String
|
||||
root: FkChainRoot?, relation(field=rootId, onDelete=Cascade)
|
||||
rootId: UuidValue?
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ table: fk_chain_middle_cascade_child
|
|||
database: all
|
||||
fields:
|
||||
id: UuidValue?, defaultPersist=random_v7
|
||||
### Owner scope of this row. Maintained by the CRDT sync layer.
|
||||
scopeId: int?
|
||||
name: String
|
||||
restrictBlocker: FkChainRestrictBlocker?, relation(field=restrictBlockerId, onDelete=Cascade)
|
||||
restrictBlockerId: UuidValue?
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ table: fk_chain_middle_set_null_child
|
|||
database: all
|
||||
fields:
|
||||
id: UuidValue?, defaultPersist=random_v7
|
||||
### Owner scope of this row. Maintained by the CRDT sync layer.
|
||||
scopeId: int?
|
||||
name: String
|
||||
restrictBlocker: FkChainRestrictBlocker?, relation(field=restrictBlockerId, onDelete=SetNull)
|
||||
restrictBlockerId: UuidValue?
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ table: fk_chain_restrict_blocker
|
|||
database: all
|
||||
fields:
|
||||
id: UuidValue?, defaultPersist=random_v7
|
||||
### Owner scope of this row. Maintained by the CRDT sync layer.
|
||||
scopeId: int?
|
||||
name: String
|
||||
cascadeMiddle: FkChainCascadeMiddle?, relation(field=cascadeMiddleId, onDelete=Restrict)
|
||||
cascadeMiddleId: UuidValue?
|
||||
|
|
|
|||
|
|
@ -3,4 +3,6 @@ table: fk_chain_root
|
|||
database: all
|
||||
fields:
|
||||
id: UuidValue?, defaultPersist=random_v7
|
||||
### Owner scope of this row. Maintained by the CRDT sync layer.
|
||||
scopeId: int?
|
||||
name: String
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ table: fk_chain_set_null_cascade_child
|
|||
database: all
|
||||
fields:
|
||||
id: UuidValue?, defaultPersist=random_v7
|
||||
### Owner scope of this row. Maintained by the CRDT sync layer.
|
||||
scopeId: int?
|
||||
name: String
|
||||
setNullMiddle: FkChainSetNullMiddle?, relation(field=setNullMiddleId, onDelete=Cascade)
|
||||
setNullMiddleId: UuidValue?
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ table: fk_chain_set_null_middle
|
|||
database: all
|
||||
fields:
|
||||
id: UuidValue?, defaultPersist=random_v7
|
||||
### Owner scope of this row. Maintained by the CRDT sync layer.
|
||||
scopeId: int?
|
||||
name: String
|
||||
cascadeMiddle: FkChainCascadeMiddle?, relation(field=cascadeMiddleId, onDelete=SetNull)
|
||||
cascadeMiddleId: UuidValue?
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ table: fk_chain_set_null_restrict_child
|
|||
database: all
|
||||
fields:
|
||||
id: UuidValue?, defaultPersist=random_v7
|
||||
### Owner scope of this row. Maintained by the CRDT sync layer.
|
||||
scopeId: int?
|
||||
name: String
|
||||
setNullMiddle: FkChainSetNullMiddle?, relation(field=setNullMiddleId, onDelete=Restrict)
|
||||
setNullMiddleId: UuidValue?
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ table: fk_chain_set_null_set_null_child
|
|||
database: all
|
||||
fields:
|
||||
id: UuidValue?, defaultPersist=random_v7
|
||||
### Owner scope of this row. Maintained by the CRDT sync layer.
|
||||
scopeId: int?
|
||||
name: String
|
||||
setNullMiddle: FkChainSetNullMiddle?, relation(field=setNullMiddleId, onDelete=SetNull)
|
||||
setNullMiddleId: UuidValue?
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ table: organization
|
|||
database: all
|
||||
fields:
|
||||
id: UuidValue?, defaultPersist=random_v7
|
||||
### Owner scope of this row. Maintained by the CRDT sync layer.
|
||||
scopeId: int?
|
||||
name: String
|
||||
people: List<Person>?, relation(name=org_person)
|
||||
city: City?, relation(name=city_org, optional, onDelete=Cascade)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ table: person
|
|||
database: all
|
||||
fields:
|
||||
id: UuidValue?, defaultPersist=random_v7
|
||||
### Owner scope of this row. Maintained by the CRDT sync layer.
|
||||
scopeId: int?
|
||||
name: String
|
||||
surname: String?
|
||||
address: Address?, relation(name=person_address)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ table: required_set_null_child
|
|||
database: all
|
||||
fields:
|
||||
id: UuidValue?, defaultPersist=random_v7
|
||||
### Owner scope of this row. Maintained by the CRDT sync layer.
|
||||
scopeId: int?
|
||||
name: String
|
||||
parent: Person?, relation(field=parentId, onDelete=SetNull)
|
||||
parentId: UuidValue
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ table: restrict_child
|
|||
database: all
|
||||
fields:
|
||||
id: UuidValue?, defaultPersist=random_v7
|
||||
### Owner scope of this row. Maintained by the CRDT sync layer.
|
||||
scopeId: int?
|
||||
name: String
|
||||
parent: Person?, relation(field=parentId, onDelete=Restrict)
|
||||
parentId: UuidValue?
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ table: town
|
|||
database: all
|
||||
fields:
|
||||
id: UuidValue?, defaultPersist=random_v7
|
||||
### Owner scope of this row. Maintained by the CRDT sync layer.
|
||||
scopeId: int?
|
||||
name: String
|
||||
city: City?, relation(optional, onDelete=Cascade)
|
||||
mayor: Person?, relation(optional, onDelete=SetNull)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ table: types
|
|||
database: all
|
||||
fields:
|
||||
id: UuidValue?, defaultPersist=random_v7
|
||||
### Owner scope of this row. Maintained by the CRDT sync layer.
|
||||
scopeId: int?
|
||||
aBool: bool
|
||||
aDateTime: DateTime
|
||||
aText: String
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue