How to display only the reservations that the logged in user made?

0
I have a reservation application which retrieves the name of the logged in user, then that gets saved along with the reservation and displayed in the "all active reservations" page, now I want to display only the reservations which are made by the current user in the "my reservations page" but I cannot get my xpath to work. This is my "GetMyReservations" microflow and in the Xpath it has  I have tried equating FullName from Reservations since that is where it gets saved and Account/FullName but this Account/FullName is empty   I get my current user data from this microflow which gets the xpath constraint [id = $currentUser], I added this microflow to my OpenMyReservations microflow to call it before showing the page.     Any ideas would be greatly appreciated, thank you in advance :)
asked
4 answers
0

If you haven't already, you should add a reference from Reservation to Account, storing the account that made the reservation as an association. You can then add an XPath in the entity that users can only see their own reservations.

This should be done on domain model level, not page level because otherwise tech savvy users would be able to retrieve other reservations as well, which you want to prevent!

image.png

answered
0

Skip Account, no need for it here.

Upon creating and saving the reservation, associate the reservation to the System.User which is the currentUser. This makes sure that you can retrieve the reservation with xpath constraint [id = $currentUser]

answered
0

My Reservation entity contains FullName and is referenced to Account and Employee(my company's SSO login entity), my microflow for opening my new reservation page retrieves the account by current user(id is $currentUser) and then changes Reservation.FullName to Account/FullName

 

So the full name is displayed based on the current user when they go into new reservation page as well as in the active reservation page.

 

So the saving is ok, the only thing I think is wrong is my logic to show only the reservations that our the current user's

 

 

answered
0

I solved it, for anyone having similar issues, my solution was to implement in my microflow which gets my reservations those retrieve account from database and an xpath constraint [(FullName = $Account_1/FullName)] in retrieve objects from reservation :)

answered