Role based query

Hi, me again.

is there anyway to have a role based query, I will try to explain. I have a page in /dashboard - secured by login. On this page I display that users bookings, that user only sees their bookings as the query has userid=identity condition.

Now i have admin users, who, when signed in should be able to see ALL bookings. I was in the process of basically duplicating the pages and setting up duplicate server connects removing the userid restrict, but would double the site admin.

Is there anyway i can have it so if a user is signed in they only see their own bookings,if admin signs in they see all bookings for all users?

in the query I guess it would be if userid=idendity or role=admin or something along those line if possible, but then the server connect query has to know the user is an admin role without passing that info in a form or link

I know how to do role base “show” elements in a page but this is a bit deeper than that.

Thanks
Darren

Community Page
Last updated: