on 11-23-2015 9:42 AM
Hi,
I have created a webdynpro application. I need to restrict the user with a permission so that he can see the textboxes and buttons only if he has the Role(and its respective actions).
Try 1
I have created the permission class in my Webdynpro java project and i have used user.hasPermission to check. I have also created a actions.xml in my same webdynpro project and defined the action and permissions.
Now, if I deploy the webdynpro application- a new action is created in the Identity Management of type J2EE. I assign the action to a new role and assign it to my user in Identity Management. But in my application, the hasPermission check is not working and it is always false.
Try 2
I tried to create a new UME project and update the actions.xml, deploy the application. Now the new action is availalbe in the Identity Management - but the action is of type UME. Now,if i add this new action to the role - my application hasPermission check works fine.
I would like to understand what is the difference between the actions of type J2EE and UME. I dont want to create a seperate project for this UME permission. I want to have this in the same webdynpro project. is it possible ? Can you please help me?
REgards,
LAkxman
Laxman,
Could you please check following code? It will give you role names. Use calculated visibility attributes for your UI elements for displaying them as per Role names retrieved -
Iterator iterator= null;
IWDClientUser clientUser = WDClientUser.getCurrentUser();
IUser user = clientUser.getSAPUser();
iterator= user.getRoles(true);
IRoleFactory rFactory= UMFactory.getRoleFactory();
while (iterator.hasNext()) {
String roleName = (String) iterator.next();
IRole role = rFactory.getRole(roleName);
}
--
Regards,
Amey
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please check this example code. it should be useful Actions in the actions.xml File
Kindly let me know if you need any more information
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.