Skip to content

Commit

Permalink
WebPlugins: abbreviation of property names
Browse files Browse the repository at this point in the history
  • Loading branch information
andreysavihin committed Dec 12, 2023
1 parent 3266f2f commit 313417e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions web/ASC.Web.Api/Api/Settings/SettingsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,14 @@ public async Task<SettingsDto> GetSettingsAsync(bool? withpassword)
settings.Plugins.Enabled = pluginsEnabled;
}

if (bool.TryParse(_configuration["plugins:allowUpload"], out var pluginsAllowUpload))
if (bool.TryParse(_configuration["plugins:upload"], out var pluginsUpload))
{
settings.Plugins.AllowUpload = pluginsAllowUpload;
settings.Plugins.Upload = pluginsUpload;
}

if (bool.TryParse(_configuration["plugins:allowDelete"], out var pluginsAllowDelete))
if (bool.TryParse(_configuration["plugins:delete"], out var pluginsDelete))
{
settings.Plugins.AllowDelete = pluginsAllowDelete;
settings.Plugins.Delete = pluginsDelete;
}

var formGallerySettings = _configurationExtension.GetSetting<OFormSettings>("files:oform");
Expand Down
4 changes: 2 additions & 2 deletions web/ASC.Web.Api/ApiModels/ResponseDto/PluginsDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public class PluginsDto

/// <summary>Specifies if the plugins can be uploaded or not</summary>
/// <type>System.Boolean, System</type>
public bool AllowUpload { get; set; }
public bool Upload { get; set; }

/// <summary>Specifies if the plugins can be deleted or not</summary>
/// <type>System.Boolean, System</type>
public bool AllowDelete { get; set; }
public bool Delete { get; set; }
}
2 changes: 1 addition & 1 deletion web/ASC.Web.Core/WebPluginManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private void DemandWebPlugins(bool upload = false, bool delete = false)
throw new SecurityException("Plugins disabled");
}

if ((upload && !_webPluginConfigSettings.AllowUpload) || (delete && !_webPluginConfigSettings.AllowDelete))
if ((upload && !_webPluginConfigSettings.Upload) || (delete && !_webPluginConfigSettings.Delete))
{
throw new SecurityException("Forbidden action");
}
Expand Down
4 changes: 2 additions & 2 deletions web/ASC.Web.Core/WebPluginSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public WebPluginConfigSettings(ConfigurationExtension configuration)
private string[] _assetExtensions;

public bool Enabled { get; set; }
public bool AllowUpload { get; set; }
public bool AllowDelete { get; set; }
public bool Upload { get; set; }
public bool Delete { get; set; }

public long MaxSize
{
Expand Down

0 comments on commit 313417e

Please sign in to comment.