create-instant-app 0.22.98 → 0.22.99-experimental.add-user-perm-rules.20792984656.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-instant-app",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.99-experimental.add-user-perm-rules.20792984656.1",
|
|
4
4
|
"description": "Scaffold a new web/mobile app with InstantDB",
|
|
5
5
|
"homepage": "https://github.com/instantdb/instant/tree/main/client/packages/create-instant-app",
|
|
6
6
|
"repository": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"ora": "6.3.1",
|
|
34
34
|
"slugify": "^1.6.6",
|
|
35
35
|
"sort-package-json": "^2.10.0",
|
|
36
|
-
"@instantdb/version": "0.22.
|
|
37
|
-
"instant-cli": "0.22.
|
|
36
|
+
"@instantdb/version": "0.22.99-experimental.add-user-perm-rules.20792984656.1",
|
|
37
|
+
"instant-cli": "0.22.99-experimental.add-user-perm-rules.20792984656.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@anthropic-ai/sdk": "^0.60.0",
|
package/template/rules/AGENTS.md
CHANGED
|
@@ -166,6 +166,35 @@ newData.ref('x')
|
|
|
166
166
|
data.ref(someVar + '.members.id')
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
+
## $users Permissions
|
|
170
|
+
|
|
171
|
+
- Default `view` permission is `auth.id == data.id`
|
|
172
|
+
- Default `create`, `update`, and `delete` permissions is false
|
|
173
|
+
- Can override `view` and `update`
|
|
174
|
+
- Cannot override `create` or `delete`
|
|
175
|
+
|
|
176
|
+
## Field-level Permissions
|
|
177
|
+
|
|
178
|
+
Restrict access to specific fields while keeping the entity public:
|
|
179
|
+
|
|
180
|
+
```json
|
|
181
|
+
{
|
|
182
|
+
"$users": {
|
|
183
|
+
"allow": {
|
|
184
|
+
"view": "true"
|
|
185
|
+
},
|
|
186
|
+
"fields": {
|
|
187
|
+
"email": "auth.id == data.id"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Notes:
|
|
194
|
+
|
|
195
|
+
- Field rules override entity-level `view` for that field
|
|
196
|
+
- Useful for hiding sensitive data (emails, phone numbers) on public entities
|
|
197
|
+
|
|
169
198
|
# Best Practices
|
|
170
199
|
|
|
171
200
|
## Pass `schema` when initializing Instant
|
|
@@ -172,6 +172,35 @@ newData.ref('x')
|
|
|
172
172
|
data.ref(someVar + '.members.id')
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
+
## $users Permissions
|
|
176
|
+
|
|
177
|
+
- Default `view` permission is `auth.id == data.id`
|
|
178
|
+
- Default `create`, `update`, and `delete` permissions is false
|
|
179
|
+
- Can override `view` and `update`
|
|
180
|
+
- Cannot override `create` or `delete`
|
|
181
|
+
|
|
182
|
+
## Field-level Permissions
|
|
183
|
+
|
|
184
|
+
Restrict access to specific fields while keeping the entity public:
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"$users": {
|
|
189
|
+
"allow": {
|
|
190
|
+
"view": "true"
|
|
191
|
+
},
|
|
192
|
+
"fields": {
|
|
193
|
+
"email": "auth.id == data.id"
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Notes:
|
|
200
|
+
|
|
201
|
+
- Field rules override entity-level `view` for that field
|
|
202
|
+
- Useful for hiding sensitive data (emails, phone numbers) on public entities
|
|
203
|
+
|
|
175
204
|
# Best Practices
|
|
176
205
|
|
|
177
206
|
## Pass `schema` when initializing Instant
|
|
@@ -172,6 +172,35 @@ newData.ref('x')
|
|
|
172
172
|
data.ref(someVar + '.members.id')
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
+
## $users Permissions
|
|
176
|
+
|
|
177
|
+
- Default `view` permission is `auth.id == data.id`
|
|
178
|
+
- Default `create`, `update`, and `delete` permissions is false
|
|
179
|
+
- Can override `view` and `update`
|
|
180
|
+
- Cannot override `create` or `delete`
|
|
181
|
+
|
|
182
|
+
## Field-level Permissions
|
|
183
|
+
|
|
184
|
+
Restrict access to specific fields while keeping the entity public:
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"$users": {
|
|
189
|
+
"allow": {
|
|
190
|
+
"view": "true"
|
|
191
|
+
},
|
|
192
|
+
"fields": {
|
|
193
|
+
"email": "auth.id == data.id"
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Notes:
|
|
200
|
+
|
|
201
|
+
- Field rules override entity-level `view` for that field
|
|
202
|
+
- Useful for hiding sensitive data (emails, phone numbers) on public entities
|
|
203
|
+
|
|
175
204
|
# Best Practices
|
|
176
205
|
|
|
177
206
|
## Pass `schema` when initializing Instant
|