on 10-09-2015 6:15 PM
Hello Experts,
We have created a webdynrpo java application. The view of that application consist of many tables. Now we have a requirement where in I have to show/hide tables according to the user who logged in to the portal.
Suppose if a manager is logging into the portal then he should be able to see all the tables of that application and on the other hand if an employee is logging in then few tables has to be hidden.
Can anybody let me know how to achieve this. What settings i have to make to get this requirement get going.
Thanks
Vamshi
Please add the com.sap.security.api.jar to your Project and write the following piece of Code to retrieve the User Name and User Id.
That above API is available in this path is @ C:\Program Files\SAP\IDE\IDE70\eclipse\plugins\com.sap.security_2.0.0\lib
try
{
IUser user = WDClientUser.getCurrentUser().getSAPUser();
//wdComponentAPI.getMessageManager().reportSuccess("User::"+user);
if(user.isMemberOfGroup("GRUP.PRIVATE_DATASOURCE.un:SCW_COATS_MTR_UG",true))
{
// GRUP.PRIVATE_DATASOURCE.un:SCW_COATS_MTR_UG---- This is Group Unique ID
wdContext.currentContextElement().setSelectTable_visible(WDVisibility.VISIBLE);
}else
{
wdContext.currentContextElement().setSelectTable_visible(WDVisibility.NONE);
}
catch(Exception ex)
{
ex.printStackTrace();
}
How to add Jar file into NWDS
Right click on project->properties->java build path->libraries tab->Add External JARs->eclipse folder->plugins folder->select jar file
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this solution:
Let's assume that all managers assign to the same company_manager Portal role.
and check if the user assigned to this company_manager and act accordantly (hide or show tables in the view)
BR,
Roman.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can use ume permission, google how to use it
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.