Marco Spera
Posts: 0
Joined: Tue Jun 17, 2014 7:14 pm

Count limited by Session Token

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Count limited by Session Token

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.

Marco Spera
Posts: 0
Joined: Tue Jun 17, 2014 7:14 pm

Count limited by Session Token

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Count limited by Session Token

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.

Marco Spera
Posts: 0
Joined: Tue Jun 17, 2014 7:14 pm

Count limited by Session Token

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Count limited by Session Token

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)
Marco Spera
Posts: 0
Joined: Tue Jun 17, 2014 7:14 pm

Count limited by Session Token

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?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Count limited by Session Token

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

Marco Spera
Posts: 0
Joined: Tue Jun 17, 2014 7:14 pm

Count limited by Session Token

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?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Count limited by Session Token

Yes, Marco. This is just workaround

Return to “Issues”