Last active
December 15, 2015 18:33
-
-
Save davideast/1d1576a5f0473af3d205 to your computer and use it in GitHub Desktop.
Securing user data - Bolt rules
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 characters
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