Skip to content

Instantly share code, notes, and snippets.

@tatat
Created October 12, 2019 15:27
Show Gist options
  • Save tatat/fb2e2dd4dfc40017f4d403ca96c9e6c0 to your computer and use it in GitHub Desktop.
Save tatat/fb2e2dd4dfc40017f4d403ca96c9e6c0 to your computer and use it in GitHub Desktop.
rules
function isValid() {
return (
isSpecifiedUser() ||
(
request.resource.data.privateKey1 == resource.data.privateKey1 &&
request.resource.data.privateKey2 == resource.data.privateKey2 &&
'publicKey' in request.resource.data
)
) && (
request.resource.data.keys().hasOnly(['privateKey1', 'privateKey2' 'publicKey'])
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment