cancel
Showing results for 
Search instead for 
Did you mean: 

Webdynpro Java - UME permission - actions.xml

0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member197472
Active Participant
0 Kudos

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

0 Kudos

Hi Amey,

THanks for the reply.

Yes, I have it as the second solution. But i thought binding the roles and its respective actions woudl make it more secure and standard.

Do you think by getting the roles, can i also check the action in that role? Please suggest the best way.

Regards,

Lakxman

vijay_kumar49
Active Contributor
0 Kudos

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

0 Kudos

Hi Vijay,

Thanks for your suggestion. But as i said in my initial post, I already tried by creating a UME project. My query is how do i do it with Webdynpro project itself without creating the additional project for UME?

Regards,

Lakxman

vijay_kumar49
Active Contributor
0 Kudos

Okay, Please try with J2EE application. PFB screen shot for your reference

Kindly let me know if you need any more information

Answers (0)