diff --git a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua index 7443b0d3..85fb943d 100644 --- a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua +++ b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua @@ -3280,6 +3280,9 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::HALLUZINATIONREMINDER::T3528806904"] = "L -- Issues UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ISSUES::T3229841001"] = "Issues" +-- This feature is managed by your organization and has therefore been disabled. +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::MANAGEDFEATURELOCK::T1416426626"] = "This feature is managed by your organization and has therefore been disabled." + -- Your Pandoc installation meets the requirements. UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::MANAGEPANDOCDEPENDENCY::T1167365374"] = "Your Pandoc installation meets the requirements." @@ -7948,12 +7951,21 @@ UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3143506997"] = "The assistant plugin -- An error occurred while sharing the plugin. UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3184210266"] = "An error occurred while sharing the plugin." +-- Your organization has disabled importing plugins. +UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3212529834"] = "Your organization has disabled importing plugins." + -- Import assistant plugin UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3246593895"] = "Import assistant plugin" +-- Your organization has disabled exporting plugins. +UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3342440765"] = "Your organization has disabled exporting plugins." + -- Share plugin archive UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3355474457"] = "Share plugin archive" +-- Your organization has disabled sharing plugins. +UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3379469503"] = "Your organization has disabled sharing plugins." + -- Close UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3448155331"] = "Close" @@ -9562,6 +9574,9 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::ASSISTANTPLUGININSTALLSERVICE::T2955 -- The generated assistant plugin uses the ID of an internal AI Studio plugin. UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::ASSISTANTPLUGININSTALLSERVICE::T3162363526"] = "The generated assistant plugin uses the ID of an internal AI Studio plugin." +-- Your organization has disabled importing plugins. +UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::ASSISTANTPLUGININSTALLSERVICE::T3212529834"] = "Your organization has disabled importing plugins." + -- The plugin archive must contain exactly one plugin.lua file. UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::ASSISTANTPLUGININSTALLSERVICE::T3355918609"] = "The plugin archive must contain exactly one plugin.lua file." @@ -9664,6 +9679,9 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::PLUGINSHARESERVICE::T2350673880"] = -- The plugin has no local directory. UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::PLUGINSHARESERVICE::T3284289028"] = "The plugin has no local directory." +-- Your organization has disabled sharing plugins. +UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::PLUGINSHARESERVICE::T3379469503"] = "Your organization has disabled sharing plugins." + -- The plugin directory is invalid: {0} UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::PLUGINSHARESERVICE::T3774594541"] = "The plugin directory is invalid: {0}" diff --git a/app/MindWork AI Studio/Components/ManagedFeatureLock.razor b/app/MindWork AI Studio/Components/ManagedFeatureLock.razor new file mode 100644 index 00000000..7301f705 --- /dev/null +++ b/app/MindWork AI Studio/Components/ManagedFeatureLock.razor @@ -0,0 +1,9 @@ +@inherits MSGComponentBase + +@if (this.IsLocked()) +{ + @* MudTooltip.RootStyle is set as a workaround for issue -> https://github.com/MudBlazor/MudBlazor/issues/10882 *@ + + + +} \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/ManagedFeatureLock.razor.cs b/app/MindWork AI Studio/Components/ManagedFeatureLock.razor.cs new file mode 100644 index 00000000..a0bb46a1 --- /dev/null +++ b/app/MindWork AI Studio/Components/ManagedFeatureLock.razor.cs @@ -0,0 +1,65 @@ +using Microsoft.AspNetCore.Components; + +namespace AIStudio.Components; + +/// +/// Shows a lock icon for features that a configuration plugin has disabled. The related +/// control stays visible but must be disabled by the caller, so users still see that the +/// feature exists and learn that their organization has locked it. +/// +public partial class ManagedFeatureLock : MSGComponentBase +{ + /// + /// Is the feature locked by a configuration plugin? + /// + [Parameter] + public Func IsLocked { get; set; } = () => false; + + /// + /// An optional text that explains the lock. Without it, the generic explanation is used. + /// + [Parameter] + public string LockText { get; set; } = string.Empty; + + /// + /// Where should the tooltip be placed? + /// + [Parameter] + public Placement Placement { get; set; } = Placement.Left; + + /// + /// The CSS class to apply to the lock icon. + /// + [Parameter] + public string Class { get; set; } = "mr-1"; + + private string LockTextOrDefault => string.IsNullOrWhiteSpace(this.LockText) + ? this.T("This feature is managed by your organization and has therefore been disabled.") + : this.LockText; + + #region Overrides of ComponentBase + + protected override async Task OnInitializedAsync() + { + this.ApplyFilters([], [ Event.CONFIGURATION_CHANGED ]); + await base.OnInitializedAsync(); + } + + #endregion + + #region Overrides of MSGComponentBase + + protected override Task ProcessIncomingMessage(ComponentBase? sendingComponent, Event triggeredEvent, T? data) where T : default + { + switch (triggeredEvent) + { + case Event.CONFIGURATION_CHANGED: + this.StateHasChanged(); + break; + } + + return Task.CompletedTask; + } + + #endregion +} \ No newline at end of file diff --git a/app/MindWork AI Studio/Pages/Plugins.razor b/app/MindWork AI Studio/Pages/Plugins.razor index 81a15a2e..20652c47 100644 --- a/app/MindWork AI Studio/Pages/Plugins.razor +++ b/app/MindWork AI Studio/Pages/Plugins.razor @@ -10,8 +10,9 @@ @T("Plugins") + - + @T("Import") @@ -118,8 +119,9 @@ @if (context is IAvailablePlugin shareablePlugin && CanSharePlugin(shareablePlugin)) { + - + } diff --git a/app/MindWork AI Studio/Pages/Plugins.razor.cs b/app/MindWork AI Studio/Pages/Plugins.razor.cs index a28a8b21..d0fbcd60 100644 --- a/app/MindWork AI Studio/Pages/Plugins.razor.cs +++ b/app/MindWork AI Studio/Pages/Plugins.razor.cs @@ -53,7 +53,7 @@ public partial class Plugins : MSGComponentBase protected override async Task OnInitializedAsync() { - this.ApplyFilters([], [ Event.PLUGINS_RELOADED ]); + this.ApplyFilters([], [ Event.PLUGINS_RELOADED, Event.CONFIGURATION_CHANGED ]); this.groupConfig = new TableGroupDefinition { @@ -214,6 +214,16 @@ public partial class Plugins : MSGComponentBase private static bool CanSharePlugin(IAvailablePlugin plugin) => plugin is { IsInternal: false, IsManagedByConfigServer: false } && !string.IsNullOrWhiteSpace(plugin.LocalPath) && !IS_SHARING_PLUGIN; + /// + /// Organizations may disable importing plugin archives by using a configuration plugin. + /// + private bool AllowPluginImport => this.SettingsManager.ConfigurationData.App.AllowUserToImportPlugins; + + /// + /// Organizations may disable sharing and exporting plugins by using a configuration plugin. + /// + private bool AllowPluginSharing => this.SettingsManager.ConfigurationData.App.AllowUserToSharePlugins; + /// /// Linux has no native share sheet, hence the plugin archive is exported to a location of the /// user's choice there. The action must be labeled accordingly. @@ -222,6 +232,8 @@ public partial class Plugins : MSGComponentBase private string SharePluginTooltip => OperatingSystem.IsLinux() ? this.T("Export plugin archive") : this.T("Share plugin archive"); + private string SharePluginLockText => OperatingSystem.IsLinux() ? this.T("Your organization has disabled exporting plugins.") : this.T("Your organization has disabled sharing plugins."); + private async Task OpenAssistantPluginEditorDialogAsync(IAvailablePlugin plugin) { var parameters = new DialogParameters @@ -299,6 +311,9 @@ public partial class Plugins : MSGComponentBase if (this.isImportingAssistantPlugin) return; + if (!this.AllowPluginImport) + return; + this.isImportingAssistantPlugin = true; await this.InvokeAsync(this.StateHasChanged); diff --git a/app/MindWork AI Studio/Plugins/configuration/plugin.lua b/app/MindWork AI Studio/Plugins/configuration/plugin.lua index 68d62027..f0b86a74 100644 --- a/app/MindWork AI Studio/Plugins/configuration/plugin.lua +++ b/app/MindWork AI Studio/Plugins/configuration/plugin.lua @@ -235,6 +235,15 @@ CONFIG["SETTINGS"] = {} -- Configure the user permission to add providers: -- CONFIG["SETTINGS"]["DataApp.AllowUserToAddProvider"] = false +-- Configure the user permission to import plugin archives from disk. +-- When set to false, the import button on the plugins page stays visible but is disabled. +-- CONFIG["SETTINGS"]["DataApp.AllowUserToImportPlugins"] = false + +-- Configure the user permission to share or export plugins as archives. +-- When set to false, the share button on the plugins page stays visible but is disabled. +-- On Linux, this button exports the plugin archive instead of using a native share sheet. +-- CONFIG["SETTINGS"]["DataApp.AllowUserToSharePlugins"] = false + -- Configure whether administration settings are visible in the UI: -- CONFIG["SETTINGS"]["DataApp.ShowAdminSettings"] = true diff --git a/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua b/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua index 787b2638..e51615ae 100644 --- a/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua +++ b/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua @@ -3282,6 +3282,9 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::HALLUZINATIONREMINDER::T3528806904"] = "L -- Issues UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ISSUES::T3229841001"] = "Probleme" +-- This feature is managed by your organization and has therefore been disabled. +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::MANAGEDFEATURELOCK::T1416426626"] = "Diese Funktion wird von Ihrer Organisation verwaltet und wurde daher deaktiviert." + -- Your Pandoc installation meets the requirements. UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::MANAGEPANDOCDEPENDENCY::T1167365374"] = "Ihre Pandoc-Installation erfüllt die Anforderungen." @@ -7950,12 +7953,21 @@ UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3143506997"] = "Das Assistent-Plugin -- An error occurred while sharing the plugin. UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3184210266"] = "Beim Teilen des Plugins ist ein Fehler aufgetreten." +-- Your organization has disabled importing plugins. +UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3212529834"] = "Ihre Organisation hat das Importieren von Plugins deaktiviert." + -- Import assistant plugin UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3246593895"] = "Assistenten-Plugin importieren" +-- Your organization has disabled exporting plugins. +UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3342440765"] = "Ihre Organisation hat das Exportieren von Plugins deaktiviert." + -- Share plugin archive UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3355474457"] = "Plugin-Archiv teilen" +-- Your organization has disabled sharing plugins. +UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3379469503"] = "Ihre Organisation hat das Teilen von Plugins deaktiviert." + -- Close UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3448155331"] = "Schließen" @@ -9564,6 +9576,9 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::ASSISTANTPLUGININSTALLSERVICE::T2955 -- The generated assistant plugin uses the ID of an internal AI Studio plugin. UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::ASSISTANTPLUGININSTALLSERVICE::T3162363526"] = "Das generierte Assistent-Plugin verwendet die ID eines internen AI-Studio-Plugins." +-- Your organization has disabled importing plugins. +UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::ASSISTANTPLUGININSTALLSERVICE::T3212529834"] = "Ihre Organisation hat das Importieren von Plugins deaktiviert." + -- The plugin archive must contain exactly one plugin.lua file. UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::ASSISTANTPLUGININSTALLSERVICE::T3355918609"] = "Das Plugin-Archiv muss genau eine plugin.lua-Datei enthalten." @@ -9666,6 +9681,9 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::PLUGINSHARESERVICE::T2350673880"] = -- The plugin has no local directory. UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::PLUGINSHARESERVICE::T3284289028"] = "Das Plugin hat kein lokales Verzeichnis." +-- Your organization has disabled sharing plugins. +UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::PLUGINSHARESERVICE::T3379469503"] = "Ihre Organisation hat das Teilen von Plugins deaktiviert." + -- The plugin directory is invalid: {0} UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::PLUGINSHARESERVICE::T3774594541"] = "Das Plugin-Verzeichnis ist ungültig: {0}" diff --git a/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua b/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua index 155379a3..7ccd162f 100644 --- a/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua +++ b/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua @@ -3282,6 +3282,9 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::HALLUZINATIONREMINDER::T3528806904"] = "L -- Issues UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::ISSUES::T3229841001"] = "Issues" +-- This feature is managed by your organization and has therefore been disabled. +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::MANAGEDFEATURELOCK::T1416426626"] = "This feature is managed by your organization and has therefore been disabled." + -- Your Pandoc installation meets the requirements. UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::MANAGEPANDOCDEPENDENCY::T1167365374"] = "Your Pandoc installation meets the requirements." @@ -7950,12 +7953,21 @@ UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3143506997"] = "The assistant plugin -- An error occurred while sharing the plugin. UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3184210266"] = "An error occurred while sharing the plugin." +-- Your organization has disabled importing plugins. +UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3212529834"] = "Your organization has disabled importing plugins." + -- Import assistant plugin UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3246593895"] = "Import assistant plugin" +-- Your organization has disabled exporting plugins. +UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3342440765"] = "Your organization has disabled exporting plugins." + -- Share plugin archive UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3355474457"] = "Share plugin archive" +-- Your organization has disabled sharing plugins. +UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3379469503"] = "Your organization has disabled sharing plugins." + -- Close UI_TEXT_CONTENT["AISTUDIO::PAGES::PLUGINS::T3448155331"] = "Close" @@ -9564,6 +9576,9 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::ASSISTANTPLUGININSTALLSERVICE::T2955 -- The generated assistant plugin uses the ID of an internal AI Studio plugin. UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::ASSISTANTPLUGININSTALLSERVICE::T3162363526"] = "The generated assistant plugin uses the ID of an internal AI Studio plugin." +-- Your organization has disabled importing plugins. +UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::ASSISTANTPLUGININSTALLSERVICE::T3212529834"] = "Your organization has disabled importing plugins." + -- The plugin archive must contain exactly one plugin.lua file. UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::ASSISTANTPLUGININSTALLSERVICE::T3355918609"] = "The plugin archive must contain exactly one plugin.lua file." @@ -9666,6 +9681,9 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::PLUGINSHARESERVICE::T2350673880"] = -- The plugin has no local directory. UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::PLUGINSHARESERVICE::T3284289028"] = "The plugin has no local directory." +-- Your organization has disabled sharing plugins. +UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::PLUGINSHARESERVICE::T3379469503"] = "Your organization has disabled sharing plugins." + -- The plugin directory is invalid: {0} UI_TEXT_CONTENT["AISTUDIO::TOOLS::SERVICES::PLUGINSHARESERVICE::T3774594541"] = "The plugin directory is invalid: {0}" diff --git a/app/MindWork AI Studio/Settings/DataModel/DataApp.cs b/app/MindWork AI Studio/Settings/DataModel/DataApp.cs index 6c0ef294..bd26dfd7 100644 --- a/app/MindWork AI Studio/Settings/DataModel/DataApp.cs +++ b/app/MindWork AI Studio/Settings/DataModel/DataApp.cs @@ -148,7 +148,17 @@ public sealed class DataApp(Expression>? configSelection = n /// Should the user be allowed to add providers? /// public bool AllowUserToAddProvider { get; set; } = ManagedConfiguration.Register(configSelection, n => n.AllowUserToAddProvider, true); - + + /// + /// Should the user be allowed to import plugin archives from disk? + /// + public bool AllowUserToImportPlugins { get; set; } = ManagedConfiguration.Register(configSelection, n => n.AllowUserToImportPlugins, true); + + /// + /// Should the user be allowed to share or export plugins as archives? + /// + public bool AllowUserToSharePlugins { get; set; } = ManagedConfiguration.Register(configSelection, n => n.AllowUserToSharePlugins, true); + /// /// Should administration settings be visible in the UI? /// diff --git a/app/MindWork AI Studio/Tools/PluginSystem/PluginConfiguration.cs b/app/MindWork AI Studio/Tools/PluginSystem/PluginConfiguration.cs index 7600f278..87acb0ea 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/PluginConfiguration.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/PluginConfiguration.cs @@ -179,6 +179,12 @@ public sealed class PluginConfiguration(bool isInternal, LuaState state, PluginT // Config: allow the user to add providers? ManagedConfiguration.TryProcessConfiguration(x => x.App, x => x.AllowUserToAddProvider, this.Id, settingsTable, dryRun); + // Config: allow the user to import plugin archives? + ManagedConfiguration.TryProcessConfiguration(x => x.App, x => x.AllowUserToImportPlugins, this.Id, settingsTable, dryRun); + + // Config: allow the user to share or export plugins? + ManagedConfiguration.TryProcessConfiguration(x => x.App, x => x.AllowUserToSharePlugins, this.Id, settingsTable, dryRun); + // Config: show administration settings? ManagedConfiguration.TryProcessConfiguration(x => x.App, x => x.ShowAdminSettings, this.Id, settingsTable, dryRun); diff --git a/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Loading.cs b/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Loading.cs index 096b1168..b96c11b0 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Loading.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Loading.cs @@ -265,6 +265,14 @@ public static partial class PluginFactory if(ManagedConfiguration.IsConfigurationLeftOver(x => x.App, x => x.AllowUserToAddProvider, AVAILABLE_PLUGINS)) wasConfigurationChanged = true; + // Check for the plugin import permission: + if(ManagedConfiguration.IsConfigurationLeftOver(x => x.App, x => x.AllowUserToImportPlugins, AVAILABLE_PLUGINS)) + wasConfigurationChanged = true; + + // Check for the plugin sharing permission: + if(ManagedConfiguration.IsConfigurationLeftOver(x => x.App, x => x.AllowUserToSharePlugins, AVAILABLE_PLUGINS)) + wasConfigurationChanged = true; + // Check for admin settings visibility: if(ManagedConfiguration.IsConfigurationLeftOver(x => x.App, x => x.ShowAdminSettings, AVAILABLE_PLUGINS)) wasConfigurationChanged = true; diff --git a/app/MindWork AI Studio/Tools/Services/AssistantPluginInstallService.cs b/app/MindWork AI Studio/Tools/Services/AssistantPluginInstallService.cs index 58aff078..4c16f5dc 100644 --- a/app/MindWork AI Studio/Tools/Services/AssistantPluginInstallService.cs +++ b/app/MindWork AI Studio/Tools/Services/AssistantPluginInstallService.cs @@ -152,6 +152,9 @@ public sealed class AssistantPluginInstallService /// Installation result that contains success state, installed plugin metadata, and a user-facing issue when installation failed. public async Task InstallArchiveAsync(string archivePath, CancellationToken token) { + if (!this.settingsManager.ConfigurationData.App.AllowUserToImportPlugins) + return Error(TB("Your organization has disabled importing plugins.")); + if (!FileTypes.IsAllowedPath(archivePath, FileTypes.PLUGIN_ARCHIVE)) return Error(TB("Please select a plugin archive with the extension .mwplugin or .zip.")); diff --git a/app/MindWork AI Studio/Tools/Services/PluginShareService.cs b/app/MindWork AI Studio/Tools/Services/PluginShareService.cs index 4e2b4abf..abc6d1e7 100644 --- a/app/MindWork AI Studio/Tools/Services/PluginShareService.cs +++ b/app/MindWork AI Studio/Tools/Services/PluginShareService.cs @@ -1,10 +1,11 @@ using System.IO.Compression; +using AIStudio.Settings; using AIStudio.Tools.PluginSystem; using AIStudio.Tools.Rust; namespace AIStudio.Tools.Services; -public sealed class PluginShareService(NativeShareService nativeShareService, RustService rustService, ILogger logger) +public sealed class PluginShareService(NativeShareService nativeShareService, RustService rustService, SettingsManager settingsManager, ILogger logger) { private static PluginShareResult ShareError(IAvailablePlugin plugin, string issue) => new(false, plugin.Name, string.Empty, issue); @@ -36,6 +37,9 @@ public sealed class PluginShareService(NativeShareService nativeShareService, Ru if (plugin.IsManagedByConfigServer) return ShareError(plugin, TB("Config Server managed plugins cannot be shared.")); + if (!settingsManager.ConfigurationData.App.AllowUserToSharePlugins) + return ShareError(plugin, TB("Your organization has disabled sharing plugins.")); + if (!TryGetPluginRoot(plugin, out var pluginRoot, out var issue)) return ShareError(plugin, issue); diff --git a/app/MindWork AI Studio/wwwroot/changelog/v26.8.1.md b/app/MindWork AI Studio/wwwroot/changelog/v26.8.1.md index cc57690b..f919c149 100644 --- a/app/MindWork AI Studio/wwwroot/changelog/v26.8.1.md +++ b/app/MindWork AI Studio/wwwroot/changelog/v26.8.1.md @@ -2,6 +2,7 @@ - Added a prototype Visual Briefing Assistant that turns documents, data, images, audio, and video into self-contained interactive HTML briefings. - Added organization-configurable defaults and visibility controls for the Visual Briefing Assistant. - Added a share button for plugins, which uses the native share dialog on Windows and macOS. For Linux, we added an export option for plugins, which stores the plugin archive at a location of your choice. -- Added an import button on the plugins page to install plugin archives directly from your disk. +- Added an import button on the plugin page to install plugin archives directly from your files. - Added the dedicated file extension `.mwplugin` for plugin archives. +- Added an option for organizations to disable importing, sharing, and exporting plugins. - Upgraded dependencies to their latest versions to improve security and stability. \ No newline at end of file