Fix the issue with assigning users to application role during updating SP
@@ -73,6 +73,7 @@ import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.user.core.UserCoreConstants;
import org.wso2.carbon.user.core.common.AbstractUserStoreManager;
import org.wso2.carbon.user.core.util.UserCoreUtil;
+import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
@@ -585,7 +586,8 @@ public class ApplicationManagementServiceImpl extends ApplicationManagementServi
if (isOwnerUpdatedInRequest(serviceProvider)) {
//It is not required to validate the user here, as the user is validating inside the updateApplication
// method above. Hence assign application role to the app owner.
- assignApplicationRole(serviceProvider.getApplicationName(), serviceProvider.getOwner().getUserName());
+ assignApplicationRole(serviceProvider.getApplicationName(),
+ MultitenantUtils.getTenantAwareUsername(serviceProvider.getOwner().toFullQualifiedUsername()));
}
updateApplicationPermissions(serviceProvider, applicationName, storedAppName);
