Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Securing user data - Bolt rules
isUser(uid) = auth != null && auth.uid == uid;
type Post {
uid: String;
title: String;
description: String;
timestamp: Number;
}
type User {
uid: String;
name: String;
username: String;
}
path /users/$uid is User {
read() = isUser($uid);
write() = isUser($uid);
}
path /posts/$postid is Post {
read() = true;
write() = isUser(this.uid);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment