Page 1 of 2

Count limited by Session Token

Posted: Mon Sep 14, 2015 1:54 pm
by Marco Spera

Hi,

I have an app that shows only certain data from a collection based on the session token of the user that is logged in.

I want to create a count query to count ALL the items, just not the ones that pertain to the logged in user.

I followed the instructions to include a "count" request in my query service, but it is still limited to the session token of the user.

If I do not map the session token from my LSV to the query request, I get back a count of 0.

How can I make it so that the session token is ignored and therefore counts ALL items in the collection?

Thanks


Count limited by Session Token

Posted: Tue Sep 15, 2015 12:19 pm
by Serhii Kulibaba

Hello Marco,

Do you use "ACL" parameters? If so - you can add one extra user, which can read all items and use it on the count request.


Count limited by Session Token

Posted: Tue Sep 15, 2015 12:33 pm
by Marco Spera

Hi Sergiy,

I do use ACL parameters, and I do have one extra user that I want to use to read all the count requests.

But how can i set the request so that it reads with this user? As far as I know I need to use a session token each time. And if that logged in user is not the same as the extra user that reads the full list of count, how can I use the correct session token? Do these tokens not reset?

Or is there a better way. Can I somehow use the USER ID instead of a session token?

Thanks


Count limited by Session Token

Posted: Wed Sep 16, 2015 1:58 pm
by Serhii Kulibaba

You have to add one more storage variable fo the session token for that user. It is impossible to use user's id instead of session token.


Count limited by Session Token

Posted: Wed Sep 16, 2015 2:05 pm
by Marco Spera

I do not understand.

If I add another storage variable for that extra use, how does it get populated if that user is never actually the one logged in? I can make it constant, but how would I know what session token to use as the constant if the session token changes on every login?

Can you explain how I can use the user ID instead of the token? Where would I put that on the Query service request so that I do not need to enter a session token?

Thanks


Count limited by Session Token

Posted: Thu Sep 17, 2015 1:49 pm
by Serhii Kulibaba

I mean:

  • create a new one user with highest permissions
  • create one more session token variable for him
  • use his session token for counting all items in DB (for other requests - use your first session token variable)

Count limited by Session Token

Posted: Thu Sep 17, 2015 1:56 pm
by Marco Spera

Yes I understand this part.

And I have already created a new user with the highest permissions.
And I can create a session token variable for him.

But how can I populate that variable with his session token? Does it not have to be him that logs in so that I can populate that session token?

I want the other user to login and then use his session token to read all items, but if he never logs in, how do I know what his session token is?


Count limited by Session Token

Posted: Tue Sep 22, 2015 8:36 pm
by Serhii Kulibaba

This fake user have to login automatically with predefined login/password. You can do it on the startScreen


Count limited by Session Token

Posted: Wed Sep 23, 2015 3:15 pm
by Marco Spera

Can you explain how I can make the fake user auto login, while still allowing the real user to login without seeing this?

Are you saying then 2 people will be logged in at a time?


Count limited by Session Token

Posted: Wed Sep 23, 2015 4:46 pm
by Serhii Kulibaba

Yes, Marco. This is just workaround