diff --git a/database/rules.bolt b/database/rules.bolt index 8dfe254..3b514f5 100644 --- a/database/rules.bolt +++ b/database/rules.bolt @@ -6,6 +6,10 @@ path /canvas/the-one-and-only/canvas { write() { true } } +path /canvas/the-one-and-only/history/{id} { + write() { createOnly(this) } +} + type Canvas { depth: Integer; canvas: Square>>>>>>; @@ -42,3 +46,9 @@ type ColorHistoryItem extends HistoryItem {} type CurrentTimestamp extends Number { validate() { this == now } } + +// Helper functions + +createOnly(value) { + prior(value) == null && value != null +} \ No newline at end of file