def METHOD_NAME(self, user, request) -> dict:
    """
    Someone who authenticates via the API should know beforehand if the related
    user has active licenses.
    """
    from baserow_premium.plugins import PremiumPlugin
    license_plugin = plugin_registry.get_by_type(PremiumPlugin).get_license_plugin()
    per_workspace_licenses = {
        workspace_id: {license_type.type: True for license_type in license_types}
        for workspace_id, license_types in license_plugin.get_active_per_workspace_licenses(
            user
        ).items()
    }
    instance_wide_licenses = {
        license_type.type: True
        for license_type in license_plugin.get_active_instance_wide_license_types(
            user
        )
    }
    return {
        "instance_wide": instance_wide_licenses,
        "per_workspace": per_workspace_licenses,
    }