Skip to content

Commit 841f5f3

Browse files
jamesnclflovilmart
authored andcommitted
Added requirement to use ignoreAcls() when retrieving data from datastore which is configured with Role based ACLs (#541)
1 parent b90a166 commit 841f5f3

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

_includes/android/local-datastore.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,23 @@ ParseObject.pinAllInBackground(listOfObjects);
4545

4646
## Retrieving
4747

48-
Storing objects is great, but it's only useful if you can then get the objects back out later. Retrieving an object from the local datastore works just like retrieving one over the network. The only difference is calling the `fromLocalDatastore` method to tell the `ParseQuery` where to look for its results.
48+
Storing objects is great, but it's only useful if you can then get the objects back out later. To retrieve an object from the local datastore, call the `fromLocalDatastore` method to tell the `ParseQuery` where to look for its results.
4949

5050
```java
51-
ParseQuery<ParseObject> query = ParseQuery.getQuery(GameScore");
51+
ParseQuery<ParseObject> query = ParseQuery.getQuery("GameScore");
5252
query.fromLocalDatastore();
53+
```
54+
55+
The only difference is that you won’t be able to access any data protected by Role based ACLs due to the fact that the Roles are stored on the server. To access this data protected by Role based ACLs, you will need to ignore ACLs when executing a Local Datastore query.
56+
57+
```java
58+
// If data is protected by Role based ACLs:
59+
query.ignoreAcls();
60+
```
61+
62+
You can then retrieve objects as normal.
63+
64+
```java
5365
query.getInBackground("xWMyZ4YE", new GetCallback<ParseObject>() {
5466
public void done(ParseObject object, ParseException e) {
5567
if (e == null) {
@@ -69,6 +81,8 @@ Often, you'll want to find a whole list of objects that match certain criteria,
6981
ParseQuery<ParseObject> query = ParseQuery.getQuery("GameScore");
7082
query.whereEqualTo("playerName", "Joe Bob");
7183
query.fromLocalDatastore();
84+
// If data is protected by Role based ACLs:
85+
query.ignoreAcls();
7286
query.findInBackground(new FindCallback<ParseObject>() {
7387
public void done(List<ParseObject> scoreList,
7488
ParseException e) {

0 commit comments

Comments
 (0)