Skip to content

Commit

Permalink
Merge pull request #123 from Lombiq/issue/OSOE-867
Browse files Browse the repository at this point in the history
OSOE-867: Addressing analyzer warnings
  • Loading branch information
Piedone authored Jun 11, 2024
2 parents 993a05d + 7b93064 commit c414f9d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public TenantLoginController(
[IgnoreAntiforgeryToken]
public async Task<IActionResult> Index(string password)
{
if (!ModelState.IsValid) return BadRequest(ModelState);

if (_shellSettings.Name.EqualsOrdinalIgnoreCase(ShellSettings.DefaultShellName))
{
return NotFound();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ public class TenantAdminPermissions : AdminPermissionBase
public static readonly Permission LoginAsAdmin =
new(nameof(LoginAsAdmin), "Able to login as an admin to any tenant from the Default tenant.");

protected override IEnumerable<Permission> AdminPermissions => new[] { LoginAsAdmin };
protected override IEnumerable<Permission> AdminPermissions => [LoginAsAdmin];
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static OrchardCoreBuilder ConfigureFeaturesGuardForAzureStorage(this Orch
builder.ConfigureFeaturesGuardWithoutOverriding(
new Dictionary<string, IEnumerable<string>>
{
["OrchardCore.Media.Azure.Storage"] = new List<string> { "OrchardCore.Media" },
["OrchardCore.Media.Azure.Storage"] = ["OrchardCore.Media"],
});

/// <summary>
Expand All @@ -26,7 +26,7 @@ public static OrchardCoreBuilder ConfigureFeaturesGuardForElasticsearch(this Orc
new Dictionary<string, IEnumerable<string>>
{
["OrchardCore.Search.Elasticsearch"] =
new List<string> { "OrchardCore.Search", "OrchardCore.Indexing" },
["OrchardCore.Search", "OrchardCore.Indexing"],
});

/// <summary>
Expand All @@ -37,7 +37,7 @@ public static OrchardCoreBuilder ConfigureFeaturesGuardForEmailQuota(this Orchar
builder.ConfigureFeaturesGuardWithoutOverriding(
new Dictionary<string, IEnumerable<string>>
{
["Lombiq.Hosting.Tenants.EmailQuotaManagement"] = new List<string> { "OrchardCore.Email" },
["Lombiq.Hosting.Tenants.EmailQuotaManagement"] = ["OrchardCore.Email"],
});

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ public ShellSettingsEditorController(
[ValidateAntiForgeryToken]
public async Task<IActionResult> Edit(ShellSettingsEditorViewModel model)
{
if (!ModelState.IsValid) return BadRequest(ModelState);

if (!await _authorizationService.AuthorizeAsync(User, ManageTenants) ||
!_shellHost.TryGetSettings(model.TenantId, out var shellSettings))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ namespace Lombiq.Hosting.Tenants.Management.Settings;

public class HideRecipesFromSetupOptions
{
public IEnumerable<string> HiddenTags { get; set; } = new[] { HideFromSetupScreen };
public IEnumerable<string> HiddenTags { get; set; } = [HideFromSetupScreen];
}

0 comments on commit c414f9d

Please sign in to comment.