4

I am trying to check whether vCenter user has privileges or not on root folder using VIM25 library. I am using hasPrivilegeOnEntity method.

vimport.hasPrivilegeOnEntity(authorizationManager, rootFolder, userSessionKey, privilages);

Above code is working fine for vCenter Server 6.0 but not working for 5.5, getting the following exception.

com.sun.xml.internal.ws.fault.ServerSOAPFaultException: Client received SOAP Fault from server: A general system error occurred: Authorize Exception Please see the server log to find more detail regarding exact cause of the failure.
    at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
    at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:124)
    at com.sun.xml.internal.ws.client.sei.StubHandler.readResponse(StubHandler.java:238)
    at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:189)
    at com.sun.xml.internal.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:276)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:104)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:77)
    at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:147)
    at com.sun.proxy.$Proxy37.hasPrivilegeOnEntity(Unknown Source)

Detail Message: A general system error occurred: Authorize Exception

1 Answers1

3

We use certain privileges to check on the particular entity for logged in user. VMware has a list of privileges.

vCenter 5.5 has 265 privileges and vCenter 6.0 has 310 privileges.

In my code, I checked the privileges for root folder (for vCenter 5.5) which were belong to vCenter 6.0 and got an exception.

After correcting the privilege list, everything worked smoothly.

While writing the code we should have privilege list which is common for vCenter 5.5 and 6.0. or just have 2 different lists as per your requirement.