Removing AllowsCultureVariation from ContentController, so we can get rid of OverrideAuthorization attribute

This commit is contained in:
Elitsa Marinovska
2020-12-08 15:36:37 +01:00
parent 474f267e69
commit 54d1e9d5e0
5 changed files with 26 additions and 27 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -127,20 +127,6 @@ namespace Umbraco.Web.BackOffice.Controllers
_logger = loggerFactory.CreateLogger<ContentController>();
_allLangs = new Lazy<IDictionary<string, ILanguage>>(() => _localizationService.GetAllLanguages().ToDictionary(x => x.IsoCode, x => x, StringComparer.InvariantCultureIgnoreCase));
}
/// <summary>
/// Returns true if any content types have culture variation enabled
/// </summary>
/// <returns></returns>
[HttpGet]
// TODO: We need to move this since we are going to delete OverrideAuthorization
[Authorize(Policy = AuthorizationPolicies.BackOfficeAccess), OverrideAuthorization]
public bool AllowsCultureVariation()
{
var contentTypes = _contentTypeService.GetAll();
return contentTypes.Any(contentType => contentType.VariesByCulture());
}
/// <summary>