Getting rid of the config file and implementing an appSetting instead

This commit is contained in:
Elitsa Marinovska
2021-03-24 15:28:06 +01:00
parent 3393ac8d03
commit eabfa7f414
6 changed files with 37 additions and 23 deletions

View File

@@ -395,6 +395,28 @@ namespace Umbraco.Core.Configuration
}
}
/// <summary>
/// Gets a value indicating whether the content dashboard should be available to all users.
/// </summary>
/// <value>
/// <c>true</c> if the dashboard is visible for all user groups; otherwise, <c>false</c>
/// and the default access rules for that dashboard will be in use.
/// </value>
public bool AllowContentDashboardAccessToAllUsers
{
get
{
try
{
return bool.Parse(ConfigurationManager.AppSettings[Constants.AppSettings.AllowContentDashboardAccessToAllUsers]);
}
catch
{
return false;
}
}
}
/// <summary>
/// An int value representing the time in milliseconds to lock the database for a write operation

View File

@@ -57,6 +57,15 @@
/// </summary>
bool UseHttps { get; }
/// <summary>
/// Gets a value indicating whether the content dashboard should be available to all users.
/// </summary>
/// <value>
/// <c>true</c> if the dashboard is visible for all user groups; otherwise, <c>false</c>
/// and the default access rules for that dashboard will be in use.
/// </value>
bool AllowContentDashboardAccessToAllUsers { get; }
/// <summary>
/// Returns a string value to determine if umbraco should skip version-checking.
/// </summary>

View File

@@ -110,6 +110,11 @@ namespace Umbraco.Core
/// </summary>
public const string UseHttps = "Umbraco.Core.UseHttps";
/// <summary>
/// A true/false value indicating whether the content dashboard should be visible for all user groups.
/// </summary>
public const string AllowContentDashboardAccessToAllUsers = "Umbraco.Core.AllowContentDashboardAccessToAllUsers";
/// <summary>
/// TODO: FILL ME IN
/// </summary>

View File

@@ -148,7 +148,6 @@
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Content Include="Config\content.dashboard.access.config.js" />
<Content Include="Config\grid.editors.config.js" />
<Content Include="Config\Lang\cs-CZ.user.xml" />
<Content Include="Config\Lang\da-DK.user.xml" />

View File

@@ -1,22 +0,0 @@
[
{
"Type": "grant",
"Value": "admin"
},
{
"Type": "grant",
"Value": "editor"
},
{
"Type": "grant",
"Value": "sensitiveData"
},
{
"Type": "grant",
"Value": "translator"
},
{
"Type": "grant",
"Value": "writer"
}
]

View File

@@ -37,6 +37,7 @@
<add key="Umbraco.Core.TimeOutInMinutes" value="20" />
<add key="Umbraco.Core.DefaultUILanguage" value="en-US" />
<add key="Umbraco.Core.UseHttps" value="false" />
<add key="Umbraco.Core.AllowContentDashboardAccessToAllUsers" value="true"/>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
<add key="webpages:Enabled" value="false" />