|
|
|
@ -46,7 +46,6 @@ import org.wso2.carbon.user.api.UserStoreException;
|
|
|
|
|
import org.wso2.carbon.user.api.UserStoreManager;
|
|
|
|
|
import org.wso2.carbon.utils.AbstractAxis2ConfigurationContextObserver;
|
|
|
|
|
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
|
|
|
|
|
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
@ -143,26 +142,6 @@ public class TenantCreateObserver extends AbstractAxis2ConfigurationContextObser
|
|
|
|
|
*/
|
|
|
|
|
private void publishScopesToTenant(String tenantDomain) throws TenantManagementException {
|
|
|
|
|
if (!MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) {
|
|
|
|
|
|
|
|
|
|
MetadataManagementService metadataManagementService = DeviceManagementDataHolder.getInstance().getMetadataManagementService();
|
|
|
|
|
|
|
|
|
|
Map<String, String> superTenantPermScopeMapping = getPermScopeMapping(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
|
|
|
|
|
Map<String, String> subTenantPermScopeMapping = getPermScopeMapping(tenantDomain);
|
|
|
|
|
|
|
|
|
|
if (superTenantPermScopeMapping == null) {
|
|
|
|
|
msg = "Error occurred while retrieving meta key '" + Constants.PERM_SCOPE_MAPPING_META_KEY + "' for tenant '" +
|
|
|
|
|
MultitenantConstants.SUPER_TENANT_DOMAIN_NAME + "'. Hence aborting publishing scopes to tenant: '" +
|
|
|
|
|
tenantDomain + "'.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new TenantManagementException(msg);
|
|
|
|
|
}
|
|
|
|
|
if (superTenantPermScopeMapping.equals(subTenantPermScopeMapping)) {
|
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
|
log.debug( "Scopes in '" + tenantDomain + "' are up to date with super tenant scopes.");
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
APIApplicationServices apiApplicationServices = DeviceManagementDataHolder.getInstance().getApiApplicationServices();
|
|
|
|
|
APIApplicationKey apiApplicationKey;
|
|
|
|
|
AccessTokenInfo accessTokenInfo;
|
|
|
|
|