Skip to content

Commit 87976e7

Browse files
ctrongminhflovilmart
authored andcommitted
Update README.md with better readOnlyMasterKey instructions (#799)
* Update README.md * Update README.md
1 parent cc78438 commit 87976e7

File tree

1 file changed

+49
-18
lines changed

1 file changed

+49
-18
lines changed

README.md

Lines changed: 49 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -319,41 +319,72 @@ var dashboard = new ParseDashboard({
319319

320320
### Makings users read-only
321321

322+
Make sure you specify the `readOnlyMasterKey` for the apps that you want to use read-only feature in "apps" configuration.
322323
You can mark a user as a read-only user:
323324

324325
```json
325326
{
326-
"apps": [{"...": "..."}],
327+
"apps": [
328+
{
329+
"appId": "myAppId1",
330+
"masterKey": "myMasterKey1",
331+
"readOnlyMasterKey": "myReadOnlyMasterKey1",
332+
"serverURL": "myURL1",
333+
"port": 4040,
334+
"production": true
335+
},
336+
{
337+
"appId": "myAppId2",
338+
"masterKey": "myMasterKey2",
339+
"readOnlyMasterKey": "myReadOnlyMasterKey2",
340+
"serverURL": "myURL2",
341+
"port": 4041,
342+
"production": true
343+
}
344+
],
327345
"users": [
328-
{
329-
"user":"user1",
330-
"pass":"pass1",
331-
"readOnly": true,
332-
"apps": [{"appId": "myAppId1"}, {"appId": "myAppId2"}]
333-
},
334-
{
335-
"user":"user2",
336-
"pass":"pass2",
337-
"apps": [{"appId": "myAppId1"}]
338-
} ]
346+
{
347+
"user":"user1",
348+
"pass":"pass1",
349+
"readOnly": true,
350+
"apps": [{"appId": "myAppId1"}, {"appId": "myAppId2"}]
351+
},
352+
{
353+
"user":"user2",
354+
"pass":"pass2",
355+
"apps": [{"appId": "myAppId1"}]
356+
}
357+
]
339358
}
340359
```
341360

342361
This way `user1` will have a readOnly access to `myAppId1` and `myAppId2`
343362

344363
### Making user's apps readOnly
345364

365+
Make sure you specify the `readOnlyMasterKey` for the apps that you want to use read-only feature in "apps" configuration.
346366
You can give read only access to a user on a per-app basis:
347367

348368
```json
349369
{
350-
"apps": [{"...": "..."}],
370+
"apps": [
371+
{
372+
"appId": "myAppId1",
373+
"masterKey": "myMasterKey1",
374+
"readOnlyMasterKey": "myReadOnlyMasterKey1",
375+
"serverURL": "myURL",
376+
"port": 4040,
377+
"production": true
378+
},
379+
{"...": "..."}
380+
],
351381
"users": [
352-
{
353-
"user":"user1",
354-
"pass":"pass1",
355-
"apps": [{"appId": "myAppId1", "readOnly": true}, {"appId": "myAppId2"}]
356-
} ]
382+
{
383+
"user":"user",
384+
"pass":"pass",
385+
"apps": [{"appId": "myAppId", "readOnly": true}, {"appId": "myAppId2"}]
386+
}
387+
]
357388
}
358389
```
359390

0 commit comments

Comments
 (0)