on 02-11-2022 12:10 PM
Hello Experts,
How we can fetch Roles from SAP UI5 application deployed in cloud foundry?
Currently , I am working on SAPUI5 application, where I have to manage my data on the basis of the launchpad roles of logged in user.
Please help me if you have knowledge on this.
Thanks Rakesh for the link. That is absolutely right. To get the roles you need a bit of custom code (unfortunately). To specify it a little further:
Using the node.js based approtuer you can add the custom code in a file on root level of the approtuer (next to the xs-app.json, package.json) and then point the start script of the approuter (in package.json) to that file instead of the standard approuter.js in the node_module. Then you can call "/me" from within you app to get the user info.
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Santiago,
the custom middleware scenario works with the standalone approuter, but not with the managed approuter that you rely on when deploying your UI5 apps to SAP Build Work Zone. But you can always restrict user access through the "scope" property in your xs-app.json routing configuration file.
I realize that this answers contradicts with my previous one. To be honest I think I didn't read the question right the first time...
can you help me on this question please, i want to restrict access to my views in sapui5 not in CAP. Thanks
https://answers.sap.com/questions/13950708/get-the-roles-of-the-logged-in-user-in-my-sapui5-a.html
User | Count |
---|---|
75 | |
8 | |
8 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.