I am having a problem querying my user collection. Users need to be able to access other users' data on the system, and I can't make a successful request to query the user database. My app is written with Angular, but whether I make my query with the REST API or the Angular API, I get the following error:
{"error":"IndirectCollectionAccessDisallowed","description":"Please use the appropriate API to access this collection for this app backend","debug":"You cannot access the user collection through the appdata API"}
The Angular code I am using to make this call looks like this:
var query = new Kinvey.Query();
query.limit(5);
var queryPromise = $kinvey.DataStore.find('user', query);
queryPromise.then(function(response) {
// Handle the successful response
}, function(error) {
// Handle the error: Continually fails with error mentioned in post
});
Any help anyone can provide would be greatly appreciated!
1 Comment
t
tnbeatty
said
about 6 years ago
So I answered my own question. I can't query the user datastore through `$kinvey.DataStore()`. In fact, that line should be changed to:
tnbeatty
{"error":"IndirectCollectionAccessDisallowed","description":"Please use the appropriate API to access this collection for this app backend","debug":"You cannot access the user collection through the appdata API"}
The Angular code I am using to make this call looks like this:
var query = new Kinvey.Query();
query.limit(5);
var queryPromise = $kinvey.DataStore.find('user', query);
queryPromise.then(function(response) {
// Handle the successful response
}, function(error) {
// Handle the error: Continually fails with error mentioned in post
});
Any help anyone can provide would be greatly appreciated!