cancel
Showing results for 
Search instead for 
Did you mean: 

Find the catalog assigned to tile

iamsahu
Explorer
0 Kudos
460

Hi,

Requirement - In my UI5 application, based on the catalog assigned for the Tile in the Fiori launchpad, i need to send the different status to the backend

Ex: If my tile in the FLP is assigned with ADMINISTRATOR Catalog then status '000010' should be send otherwise status '000020' should be assigned.

Question - How to find out the assigned catalog when i open the particular application(By clicking on the TILE through FLP).

ss-catalogs.png

GregMalewski
Contributor
0 Kudos

You should not have the same target mapping in two different business catalogs. The correct way to enable administrator functions for admin and a different set of functions for others is through two separate business catalogs with two different target mappings.

GregMalewski
Contributor
0 Kudos

@charanaraj sahus Could you share a broader picture with us? Why are you setting the same target mapping in two different business catalogs?

Accepted Solutions (0)

Answers (1)

Answers (1)

maheshpalavalli
Active Contributor

You can do it easily in two ways:

1. Create two tiles one for the administrator and the other for a normal user, then use pass different parameters at tile level or if you will create two target mappings, then you can also pass parameters there. Then based on the parameters you can find out which type of user he is.

2. In the backend or from the front end, read if the user has the role: ADMIN or XYZ is assigned based on that pass the status.

If you still insist on find the catalogs of the user, you can use this service. Still i wouldn't recommend this option also and would suggest option1

/sap/opu/odata/UI2/PAGE_BUILDER_PERS/Pages('%2FUI2%2FFiori2LaunchpadHome')/allCatalogs

I would prefer the first option as it will be clean & you will be utilizing the power of tiles & parameters.

GregMalewski
Contributor
0 Kudos

I would avoid developing an app with code that works differently depending on the roles read. Such an app would not leave the su53 trace, and its behavior could be confusing for future support. Also, checking roles in the frontend would not be secure.

maheshpalavalli
Active Contributor
0 Kudos

grzegorz.malewski you are right, I meant two target mappings with two tiles, of course they will be different catalogs. and yes, frontend is not secure, so better from backend, but still, it is better to go with first option I believe or is it the bakcend role determintation.?

I feel it would be backend role & stauts determination, because, from frontend, user can still manipulate the data. So i will change by preferred option to option 2, using backend role determination

GregMalewski
Contributor
0 Kudos

Before answering, Charanaraj needs to tell us what is his actual goal.

maheshpalavalli
Active Contributor
0 Kudos

Greg Malewski, his requirement is based on the catalog assigned to the user, he needs to send the status, which is a valid requirement.

But now I saw your comment again and came to a different conclusion.

I would still prefer to do this in the backend though. Instead of querying the role(which he again needs to maintain that role in a config table), I think it is better to create an authorization object and assign it to the roles of Administrator and the general user. So the OP can assign this authorization object to the role of Administrator. This way, while saving the data in the backend, OP can do an authorization check and if it is a success he can pass the required status else the normal status.

What do you say?

PS: I am not trying to argue, this topic looks interesting and I am very happy that this discussion is leading to a positive outcome. I hope you are not taking this in the wrong way.

GregMalewski
Contributor
0 Kudos

No worries, I'm okay with discussion 🙂 Please see my comment above. Let's have more insight from the author.