mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-11 02:27:21 +00:00
Moved all extension methods into extension blocks (#1155)
This commit is contained in:
1 parent
acc7d09fa2
commit
c0a75f39ac
138 files changed
+5884
-4954
No files matched your search
@@ -30,26 +30,28 @@ public static class DataSourceOutboundDataExtensions
|
||||
? organizationMinimum.StricterOf(OutboundDataRestriction.ONLY_CONFIGURED_SERVICES)
|
||||
: organizationMinimum;
|
||||
|
||||
/// <summary>
|
||||
/// The least strict level this data source may have.
|
||||
/// </summary>
|
||||
/// <param name="dataSource">The data source.</param>
|
||||
/// <param name="organizationMinimum">The least strict level the organization allows, see DataSourceSecuritySettings.MinimumOutboundDataRestriction.</param>
|
||||
/// <returns>The least strict level allowed.</returns>
|
||||
public static OutboundDataRestriction GetMinimumOutboundDataRestriction(this IDataSource dataSource, OutboundDataRestriction organizationMinimum) =>
|
||||
GetMinimumOutboundDataRestriction(dataSource is IExternalDataSource externalDataSource ? externalDataSource.SecurityPolicy : DataSourceSecurity.NOT_SPECIFIED, organizationMinimum);
|
||||
extension(IDataSource dataSource)
|
||||
{
|
||||
/// <summary>
|
||||
/// The least strict level this data source may have.
|
||||
/// </summary>
|
||||
/// <param name="organizationMinimum">The least strict level the organization allows, see DataSourceSecuritySettings.MinimumOutboundDataRestriction.</param>
|
||||
/// <returns>The least strict level allowed.</returns>
|
||||
public OutboundDataRestriction GetMinimumOutboundDataRestriction(OutboundDataRestriction organizationMinimum) =>
|
||||
GetMinimumOutboundDataRestriction(dataSource is IExternalDataSource externalDataSource ? externalDataSource.SecurityPolicy : DataSourceSecurity.NOT_SPECIFIED, organizationMinimum);
|
||||
|
||||
/// <summary>
|
||||
/// Where a chat may still send data, once passages of this data source reached it.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The level of the data source, tightened to the least strict one it may have. This holds at
|
||||
/// runtime, not only in the dialog: a data source stored before, or one a configuration plugin
|
||||
/// provides, is never edited, so its stored level may be less strict.
|
||||
/// </remarks>
|
||||
/// <param name="dataSource">The data source.</param>
|
||||
/// <param name="organizationMinimum">The least strict level the organization allows, see DataSourceSecuritySettings.MinimumOutboundDataRestriction.</param>
|
||||
/// <returns>The level which applies.</returns>
|
||||
public static OutboundDataRestriction GetEffectiveOutboundDataRestriction(this IDataSource dataSource, OutboundDataRestriction organizationMinimum) =>
|
||||
dataSource.OutboundDataRestriction.StricterOf(dataSource.GetMinimumOutboundDataRestriction(organizationMinimum));
|
||||
/// <summary>
|
||||
/// Where a chat may still send data, once passages of this data source reached it.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The level of the data source, tightened to the least strict one it may have. This holds at
|
||||
/// runtime, not only in the dialog: a data source stored before, or one a configuration plugin
|
||||
/// provides, is never edited, so its stored level may be less strict.
|
||||
/// </remarks>
|
||||
/// <param name="organizationMinimum">The least strict level the organization allows, see DataSourceSecuritySettings.MinimumOutboundDataRestriction.</param>
|
||||
/// <returns>The level which applies.</returns>
|
||||
public OutboundDataRestriction GetEffectiveOutboundDataRestriction(OutboundDataRestriction organizationMinimum) =>
|
||||
dataSource.OutboundDataRestriction.StricterOf(dataSource.GetMinimumOutboundDataRestriction(organizationMinimum));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user