WSO2 IS 5.1.0 - Error while updating Service Provider using Soap

Viewed 100

While updating permissions to service provider, sometimes leaf nodes are not getting deleted.

For example,

following permissions exist in Service Provider,

BILL/ADD
BILL/REMOVE
REPORT/ADD
REPORT/REMOVE

on update with only following permission,

REPORT/ADD
REPORT/REMOVE

Sample SOAP Call:

Endpoint:

services/IdentityApplicationManagementService.IdentityApplicationManagementServiceHttpsSoap11Endpoint/

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://org.apache.axis2/xsd" xmlns:xsd1="http://model.common.application.identity.carbon.wso2.org/xsd">
   <soapenv:Header/>
   <soapenv:Body>
      <xsd:updateApplication>
         <xsd:serviceProvider>
            <xsd1:applicationID>1</xsd1:applicationID>
            <xsd1:applicationName>SP1</xsd1:applicationName>
            <xsd1:permissionAndRoleConfig>
               <xsd1:permissions>
                  <xsd1:value>REPORT/ADD</xsd1:value>
               </xsd1:permissions>
               <xsd1:permissions>
                  <xsd1:value>REPORT/REMOVE</xsd1:value>
               </xsd1:permissions>
            </xsd1:permissionAndRoleConfig>
            <xsd1:inboundProvisioningConfig>
            </xsd1:inboundProvisioningConfig>
            <xsd1:outboundProvisioningConfig>
            </xsd1:outboundProvisioningConfig>
         </xsd:serviceProvider>
      </xsd:updateApplication>
   </soapenv:Body>
</soapenv:Envelope>

BILL/ADD & BILL/REMOVE has been removed. But after successful update, "BILL" still exist in permission list.

After Update:

BILL
REPORT/ADD
REPORT/REMOVE

And on sometimes, adding/removing multiple permission collapses the other permission nodes

1 Answers

Instead of updating the application, add/remove resource in the application will resolve the issue.

For example for application sample,

SOAP API URL :

/services/ResourceAdminService.ResourceAdminServiceHttpsSoap12Endpoint/

Add Resource:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ser="http://services.resource.registry.carbon.wso2.org">
   <soap:Header/>
   <soap:Body>
      <ser:addCollection>
         <!--Optional:-->
         <ser:parentPath>/_system/governance/permission/applications/sample/REPORT</ser:parentPath>
         <!--Optional:-->
         <ser:collectionName>CREATE</ser:collectionName>
         <!--Optional:-->
         <ser:mediaType>?</ser:mediaType>
         <!--Optional:-->
         <ser:description>?</ser:description>
      </ser:addCollection>
   </soap:Body>
</soap:Envelope>

Delete Resource :

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ser="http://services.resource.registry.carbon.wso2.org">
   <soap:Header/>
   <soap:Body>
      <ser:delete>
         <!--Optional:-->
         <ser:pathToDelete>/_system/governance/permission/applications/sample/BILL</ser:pathToDelete>
      </ser:delete>
   </soap:Body>
</soap:Envelope>
Related