VMware {code} Community
MichaelKarpinsk
Contributor
Contributor
Jump to solution

How to determine vSphere user's role from remote plug-in

We are developing a remote plug-in for the vSphere client. Within our plug-in's interface, we want to show/hide the appropriate UI elements depending on the role of the logged in vSphere user. For example, if we create new custom roles for "Example Plugin Admin" and "Example Plugin Read-Only" and assign them to vSphere users, is there a way within our remote plug-in application to determine which of these roles is assigned to the logged-in user?

Also, is there a way to hide our remote plug-in menu option from the vSphere client entirely if the user does not have any of the appropriate roles assigned?

The versions of vSphere client we are planning to support with this remote plug-in are 7.0 U1 and 6.7 U3.

I would greatly appreciate any guidance, thanks!

Labels (2)
0 Kudos
1 Solution

Accepted Solutions
Denis_Chorbadzh
VMware Employee
VMware Employee
Jump to solution

Hi Michael,

 

Yes, you can check the logged in user's privileges -  we have demonstrated how to do this in our remote plugin sample:

/samples/remote-plugin-sample/src/main/java/com/vmware/sample/remote/vim25/services/AuthorizationService.java

In 7.0 U1 we have introduced the notion of Dynamic Extensions which enable you to show/hide (enable/disable) certain UI extensions based on a condition. We have also demonstrated this in our latest changes to the remote plugin sample:

/samples/remote-plugin-sample/src/main/java/com/vmware/sample/remote/controllers/DynamicItemsController.java

You can read more in the official documentation.

Have in mind that this is not supported in 6.7 U3.

For previous versions, you can just show an information to the user that the view is not available.

 

Let us know if you have any questions.

 

Best Regards,

Denis

View solution in original post

1 Reply
Denis_Chorbadzh
VMware Employee
VMware Employee
Jump to solution

Hi Michael,

 

Yes, you can check the logged in user's privileges -  we have demonstrated how to do this in our remote plugin sample:

/samples/remote-plugin-sample/src/main/java/com/vmware/sample/remote/vim25/services/AuthorizationService.java

In 7.0 U1 we have introduced the notion of Dynamic Extensions which enable you to show/hide (enable/disable) certain UI extensions based on a condition. We have also demonstrated this in our latest changes to the remote plugin sample:

/samples/remote-plugin-sample/src/main/java/com/vmware/sample/remote/controllers/DynamicItemsController.java

You can read more in the official documentation.

Have in mind that this is not supported in 6.7 U3.

For previous versions, you can just show an information to the user that the view is not available.

 

Let us know if you have any questions.

 

Best Regards,

Denis