-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstant.perms.ts
44 lines (41 loc) · 1.07 KB
/
instant.perms.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Docs: https://www.instantdb.com/docs/permissions
import type { InstantRules } from "@instantdb/core";
const rules = {
/**
* Welcome to Instant's permission system!
* Right now your rules are empty. To start filling them in, check out the docs:
* https://www.instantdb.com/docs/permissions
*
* Here's an example to give you a feel:
* posts: {
* allow: {
* view: "true",
* create: "isOwner",
* update: "isOwner",
* delete: "isOwner",
* },
* bind: ["isOwner", "data.creator == auth.uid"],
* },
*/
galleries: {
bind: ["isOwner", "data.owner.owner.id == auth.uid"],
allow: {
view: "true",
$default: "isOwner",
},
},
$users: {
allow: {
$default: "true",
update: "false",
},
},
profiles: {
bind: ["isOwner", "data.owner.id == auth.uid"],
allow: {
view: "true",
$default: "isOwner",
},
},
} satisfies InstantRules;
export default rules;