Created
May 18, 2020 15:27
-
-
Save katowulf/36196c88e0d5593c2021d8b5950c73af to your computer and use it in GitHub Desktop.
Revisions
-
Kato Richardson renamed this gist
May 18, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Kato Richardson created this gist
May 18, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ { "aListOfRecords": { // when querying our list, must get less than 50 at a time and be authenticated ".read": "auth != null && (query.limitToFirst <= 50 || query.limitToLast <= 50)", "$aRecordId": { // When fetching a single record, I must be logged in ".read": "auth != null", // When writing a record, I must be logged in ".write": "auth != null", // Validate my schema "aNumberField": { ".validate": "newData.isNumber() && newData.val() > -1 && newData.val() < 51" }, "aStringField": { ".validate": "newData.isString() && newData.val().length < 4" } // Disallow any fields not in my schema "$other": { ".validate": false } } } }