From 35680bba46fb1e7911c04e9c29a8f780a4d1ba1e Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Tue, 19 May 2020 09:52:58 +0200 Subject: [PATCH] https://dev.azure.com/umbraco/D-Team%20Tracker/_workitems/edit/6586 - Migrated DashboardController and BackOfficeAssetsController --- .../Controllers/AuthenticationController.cs | 27 +++++- .../BackOfficeAssetsController.cs | 5 +- .../Controllers/BackOfficeController.cs | 10 ++- .../Controllers}/DashboardController.cs | 87 +++++++++---------- .../Filters/EditorModelEventManager.cs | 74 ++++++++++++++++ .../OutgoingEditorModelEventAttribute.cs | 46 ++++++++++ .../Security/WebSecurity.cs | 33 ++++++- .../UmbracoContext/UmbracoContextFactory.cs | 2 +- .../Editors/BackOfficeController.cs | 61 ------------- .../Editors/BackOfficeServerVariables.cs | 18 ++-- src/Umbraco.Web/Umbraco.Web.csproj | 2 - 11 files changed, 241 insertions(+), 124 deletions(-) rename src/{Umbraco.Web/Editors => Umbraco.Web.BackOffice/Controllers}/BackOfficeAssetsController.cs (95%) rename src/{Umbraco.Web/Editors => Umbraco.Web.BackOffice/Controllers}/DashboardController.cs (68%) create mode 100644 src/Umbraco.Web.BackOffice/Filters/EditorModelEventManager.cs create mode 100644 src/Umbraco.Web.BackOffice/Filters/OutgoingEditorModelEventAttribute.cs diff --git a/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs b/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs index cb0cb4cc50..8ed4f8368b 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs @@ -1,6 +1,9 @@ using Microsoft.AspNetCore.Mvc; +using Umbraco.Core; using Umbraco.Web.Common.Attributes; +using Umbraco.Web.Common.Controllers; using Umbraco.Web.Common.Filters; +using Umbraco.Web.Security; using Constants = Umbraco.Core.Constants; namespace Umbraco.Web.BackOffice.Controllers @@ -9,8 +12,30 @@ namespace Umbraco.Web.BackOffice.Controllers //[ValidationFilter] // TODO: I don't actually think this is required with our custom Application Model conventions applied [TypeFilter(typeof(AngularJsonOnlyConfigurationAttribute))] // TODO: This could be applied with our Application Model conventions [IsBackOffice] // TODO: This could be applied with our Application Model conventions - public class AuthenticationController : ControllerBase + public class AuthenticationController : UmbracoApiController { + private readonly IUmbracoContextAccessor _umbracoContextAccessor; // TODO: We need to import the logic from Umbraco.Web.Editors.AuthenticationController and it should not be an auto-routed api controller + + public AuthenticationController(IUmbracoContextAccessor umbracoContextAccessor) + { + _umbracoContextAccessor = umbracoContextAccessor; + } + + /// + /// Checks if the current user's cookie is valid and if so returns OK or a 400 (BadRequest) + /// + /// + [HttpGet] + public bool IsAuthenticated() + { + var umbracoContext = _umbracoContextAccessor.GetRequiredUmbracoContext(); + var attempt = umbracoContext.Security.AuthorizeRequest(); + if (attempt == ValidateRequestAttempt.Success) + { + return true; + } + return false; + } } } diff --git a/src/Umbraco.Web/Editors/BackOfficeAssetsController.cs b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeAssetsController.cs similarity index 95% rename from src/Umbraco.Web/Editors/BackOfficeAssetsController.cs rename to src/Umbraco.Web.BackOffice/Controllers/BackOfficeAssetsController.cs index d7bfc5c1fa..c549679251 100644 --- a/src/Umbraco.Web/Editors/BackOfficeAssetsController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeAssetsController.cs @@ -2,12 +2,11 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Web.Http; -using Umbraco.Core.Composing; +using Microsoft.AspNetCore.Mvc; using Umbraco.Core.Configuration; using Umbraco.Core.IO; using Umbraco.Core.Logging; -using Umbraco.Web.Mvc; +using Umbraco.Web.Common.Attributes; namespace Umbraco.Web.Editors { diff --git a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs index 0e244abda2..d8c0216341 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs @@ -31,7 +31,13 @@ namespace Umbraco.Web.BackOffice.Controllers private readonly ILocalizedTextService _textService; private readonly IGridConfig _gridConfig; - public BackOfficeController(IRuntimeMinifier runtimeMinifier, IGlobalSettings globalSettings, IHostingEnvironment hostingEnvironment, IUmbracoContextAccessor umbracoContextAccessor, ILocalizedTextService textService, IGridConfig gridConfig) + public BackOfficeController( + IRuntimeMinifier runtimeMinifier, + IGlobalSettings globalSettings, + IHostingEnvironment hostingEnvironment, + IUmbracoContextAccessor umbracoContextAccessor, + ILocalizedTextService textService, + IGridConfig gridConfig) { _runtimeMinifier = runtimeMinifier; _globalSettings = globalSettings; @@ -107,5 +113,7 @@ namespace Umbraco.Web.BackOffice.Controllers { return new JsonNetResult { Data = _gridConfig.EditorsConfig.Editors, Formatting = Formatting.None }; } + + } } diff --git a/src/Umbraco.Web/Editors/DashboardController.cs b/src/Umbraco.Web.BackOffice/Controllers/DashboardController.cs similarity index 68% rename from src/Umbraco.Web/Editors/DashboardController.cs rename to src/Umbraco.Web.BackOffice/Controllers/DashboardController.cs index 84aad2d0c0..6a8e37a8ec 100644 --- a/src/Umbraco.Web/Editors/DashboardController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/DashboardController.cs @@ -2,38 +2,39 @@ using Umbraco.Core; using Umbraco.Core.Configuration; using Umbraco.Web.Models.ContentEditing; -using Umbraco.Web.Mvc; using Newtonsoft.Json.Linq; using System.Threading.Tasks; using System.Net.Http; using System; using System.Linq; -using System.Net; using System.Text; +using Microsoft.AspNetCore.Mvc; using Umbraco.Core.Cache; -using Umbraco.Web.WebApi; -using Umbraco.Web.WebApi.Filters; using Umbraco.Core.Logging; using Umbraco.Core.Persistence; using Umbraco.Core.Services; using Umbraco.Core.Strings; using Umbraco.Core.Dashboards; -using Umbraco.Core.Strings; using Umbraco.Web.Services; -using Umbraco.Core.Mapping; -using Umbraco.Web.Routing; +using Umbraco.Web.BackOffice.Filters; +using Umbraco.Web.Common.Attributes; +using Umbraco.Web.Common.Controllers; +using Umbraco.Web.Common.Filters; +using Umbraco.Web.WebApi.Filters; -namespace Umbraco.Web.Editors +namespace Umbraco.Web.BackOffice.Controllers { //we need to fire up the controller like this to enable loading of remote css directly from this controller [PluginController("UmbracoApi")] [ValidationFilter] - [AngularJsonOnlyConfiguration] + [TypeFilter(typeof(AngularJsonOnlyConfigurationAttribute))] // TODO: This could be applied with our Application Model conventions [IsBackOffice] - [WebApi.UmbracoAuthorize] - + [UmbracoAuthorize] public class DashboardController : UmbracoApiController { + private readonly IUmbracoContextAccessor _umbracoContextAccessor; + private readonly AppCaches _appCaches; + private readonly ILogger _logger; private readonly IDashboardService _dashboardService; private readonly IUmbracoVersion _umbracoVersion; private readonly IShortStringHelper _shortStringHelper; @@ -47,15 +48,16 @@ namespace Umbraco.Web.Editors ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, - IProfilingLogger logger, + ILogger logger, IRuntimeState runtimeState, IDashboardService dashboardService, IUmbracoVersion umbracoVersion, - IShortStringHelper shortStringHelper, - UmbracoMapper umbracoMapper, - IPublishedUrlProvider publishedUrlProvider) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoMapper,publishedUrlProvider) + IShortStringHelper shortStringHelper) + { + _umbracoContextAccessor = umbracoContextAccessor; + _appCaches = appCaches; + _logger = logger; _dashboardService = dashboardService; _umbracoVersion = umbracoVersion; _shortStringHelper = shortStringHelper; @@ -65,10 +67,10 @@ namespace Umbraco.Web.Editors private static readonly HttpClient HttpClient = new HttpClient(); //we have baseurl as a param to make previewing easier, so we can test with a dev domain from client side - [ValidateAngularAntiForgeryToken] + [TypeFilter(typeof(ValidateAngularAntiForgeryTokenAttribute))] public async Task GetRemoteDashboardContent(string section, string baseUrl = "https://dashboard.umbraco.org/") { - var user = Security.CurrentUser; + var user = _umbracoContextAccessor.GetRequiredUmbracoContext().Security.CurrentUser; var allowedSections = string.Join(",", user.AllowedSections); var language = user.Language; var version = _umbracoVersion.SemanticVersion.ToSemanticString(); @@ -76,7 +78,7 @@ namespace Umbraco.Web.Editors var url = string.Format(baseUrl + "{0}?section={0}&allowed={1}&lang={2}&version={3}", section, allowedSections, language, version); var key = "umbraco-dynamic-dashboard-" + language + allowedSections.Replace(",", "-") + section; - var content = AppCaches.RuntimeCache.GetCacheItem(key); + var content = _appCaches.RuntimeCache.GetCacheItem(key); var result = new JObject(); if (content != null) { @@ -92,26 +94,26 @@ namespace Umbraco.Web.Editors content = JObject.Parse(json); result = content; - AppCaches.RuntimeCache.InsertCacheItem(key, () => result, new TimeSpan(0, 30, 0)); + _appCaches.RuntimeCache.InsertCacheItem(key, () => result, new TimeSpan(0, 30, 0)); } catch (HttpRequestException ex) { - Logger.Error(ex.InnerException ?? ex, "Error getting dashboard content from {Url}", url); + _logger.Error(ex.InnerException ?? ex, "Error getting dashboard content from {Url}", url); //it's still new JObject() - we return it like this to avoid error codes which triggers UI warnings - AppCaches.RuntimeCache.InsertCacheItem(key, () => result, new TimeSpan(0, 5, 0)); + _appCaches.RuntimeCache.InsertCacheItem(key, () => result, new TimeSpan(0, 5, 0)); } } return result; } - public async Task GetRemoteDashboardCss(string section, string baseUrl = "https://dashboard.umbraco.org/") + public async Task GetRemoteDashboardCss(string section, string baseUrl = "https://dashboard.umbraco.org/") { var url = string.Format(baseUrl + "css/dashboard.css?section={0}", section); var key = "umbraco-dynamic-dashboard-css-" + section; - var content = AppCaches.RuntimeCache.GetCacheItem(key); + var content = _appCaches.RuntimeCache.GetCacheItem(key); var result = string.Empty; if (content != null) @@ -130,24 +132,23 @@ namespace Umbraco.Web.Editors result = content; //save server content for 30 mins - AppCaches.RuntimeCache.InsertCacheItem(key, () => result, new TimeSpan(0, 30, 0)); + _appCaches.RuntimeCache.InsertCacheItem(key, () => result, new TimeSpan(0, 30, 0)); } catch (HttpRequestException ex) { - Logger.Error(ex.InnerException ?? ex, "Error getting dashboard CSS from {Url}", url); + _logger.Error(ex.InnerException ?? ex, "Error getting dashboard CSS from {Url}", url); //it's still string.Empty - we return it like this to avoid error codes which triggers UI warnings - AppCaches.RuntimeCache.InsertCacheItem(key, () => result, new TimeSpan(0, 5, 0)); + _appCaches.RuntimeCache.InsertCacheItem(key, () => result, new TimeSpan(0, 5, 0)); } } - return new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(result, Encoding.UTF8, "text/css") - }; + + return Content(result,"text/css", Encoding.UTF8); + } - public async Task GetRemoteXml(string site, string url) + public async Task GetRemoteXml(string site, string url) { // This is used in place of the old feedproxy.config // Which was used to grab data from our.umbraco.com, umbraco.com or umbraco.tv @@ -168,14 +169,14 @@ namespace Umbraco.Web.Editors break; default: - return new HttpResponseMessage(HttpStatusCode.NotFound); + return NotFound(); } //Make remote call to fetch videos or remote dashboard feed data var key = $"umbraco-XML-feed-{site}-{url.ToCleanString(_shortStringHelper, CleanStringType.UrlSegment)}"; - var content = AppCaches.RuntimeCache.GetCacheItem(key); + var content = _appCaches.RuntimeCache.GetCacheItem(key); var result = string.Empty; if (content != null) @@ -194,30 +195,28 @@ namespace Umbraco.Web.Editors result = content; //save server content for 30 mins - AppCaches.RuntimeCache.InsertCacheItem(key, () => result, new TimeSpan(0, 30, 0)); + _appCaches.RuntimeCache.InsertCacheItem(key, () => result, new TimeSpan(0, 30, 0)); } catch (HttpRequestException ex) { - Logger.Error(ex.InnerException ?? ex, "Error getting remote dashboard data from {UrlPrefix}{Url}", urlPrefix, url); + _logger.Error(ex.InnerException ?? ex, "Error getting remote dashboard data from {UrlPrefix}{Url}", urlPrefix, url); //it's still string.Empty - we return it like this to avoid error codes which triggers UI warnings - AppCaches.RuntimeCache.InsertCacheItem(key, () => result, new TimeSpan(0, 5, 0)); + _appCaches.RuntimeCache.InsertCacheItem(key, () => result, new TimeSpan(0, 5, 0)); } } - return new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new StringContent(result, Encoding.UTF8, "text/xml") - }; + return Content(result,"text/xml", Encoding.UTF8); } // return IDashboardSlim - we don't need sections nor access rules - [ValidateAngularAntiForgeryToken] - [OutgoingEditorModelEvent] + [TypeFilter(typeof(ValidateAngularAntiForgeryTokenAttribute))] + [TypeFilter(typeof(OutgoingEditorModelEventAttribute))] public IEnumerable> GetDashboard(string section) { - return _dashboardService.GetDashboards(section, Security.CurrentUser).Select(x => new Tab + var currentUser = _umbracoContextAccessor.GetRequiredUmbracoContext().Security.CurrentUser; + return _dashboardService.GetDashboards(section, currentUser).Select(x => new Tab { Id = x.Id, Alias = x.Alias, diff --git a/src/Umbraco.Web.BackOffice/Filters/EditorModelEventManager.cs b/src/Umbraco.Web.BackOffice/Filters/EditorModelEventManager.cs new file mode 100644 index 0000000000..7255c91f49 --- /dev/null +++ b/src/Umbraco.Web.BackOffice/Filters/EditorModelEventManager.cs @@ -0,0 +1,74 @@ +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc.Filters; +using Umbraco.Core.Dashboards; +using Umbraco.Core.Events; +using Umbraco.Web.Models.ContentEditing; + +namespace Umbraco.Web.Editors +{ + /// + /// Used to emit events for editor models in the back office + /// + public sealed class EditorModelEventManager + { + public static event TypedEventHandler> SendingContentModel; + public static event TypedEventHandler> SendingMediaModel; + public static event TypedEventHandler> SendingMemberModel; + public static event TypedEventHandler> SendingUserModel; + + public static event TypedEventHandler>>> SendingDashboardSlimModel; + + private static void OnSendingDashboardModel(ActionExecutedContext sender, EditorModelEventArgs>> e) + { + var handler = SendingDashboardSlimModel; + handler?.Invoke(sender, e); + } + + private static void OnSendingUserModel(ActionExecutedContext sender, EditorModelEventArgs e) + { + var handler = SendingUserModel; + handler?.Invoke(sender, e); + } + + private static void OnSendingContentModel(ActionExecutedContext sender, EditorModelEventArgs e) + { + var handler = SendingContentModel; + handler?.Invoke(sender, e); + } + + private static void OnSendingMediaModel(ActionExecutedContext sender, EditorModelEventArgs e) + { + var handler = SendingMediaModel; + handler?.Invoke(sender, e); + } + + private static void OnSendingMemberModel(ActionExecutedContext sender, EditorModelEventArgs e) + { + var handler = SendingMemberModel; + handler?.Invoke(sender, e); + } + + /// + /// Based on the type, emit's a specific event + /// + /// + /// + internal static void EmitEvent(ActionExecutedContext sender, EditorModelEventArgs e) + { + if (e.Model is ContentItemDisplay) + OnSendingContentModel(sender, new EditorModelEventArgs(e)); + + if (e.Model is MediaItemDisplay) + OnSendingMediaModel(sender, new EditorModelEventArgs(e)); + + if (e.Model is MemberDisplay) + OnSendingMemberModel(sender, new EditorModelEventArgs(e)); + + if (e.Model is UserDisplay) + OnSendingUserModel(sender, new EditorModelEventArgs(e)); + + if (e.Model is IEnumerable>) + OnSendingDashboardModel(sender, new EditorModelEventArgs>>(e)); + } + } +} diff --git a/src/Umbraco.Web.BackOffice/Filters/OutgoingEditorModelEventAttribute.cs b/src/Umbraco.Web.BackOffice/Filters/OutgoingEditorModelEventAttribute.cs new file mode 100644 index 0000000000..5c9e646ba0 --- /dev/null +++ b/src/Umbraco.Web.BackOffice/Filters/OutgoingEditorModelEventAttribute.cs @@ -0,0 +1,46 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Filters; +using Umbraco.Core; +using Umbraco.Web.Editors; + +namespace Umbraco.Web.WebApi.Filters +{ + /// + /// Used to emit outgoing editor model events + /// + internal sealed class OutgoingEditorModelEventAttribute : ActionFilterAttribute + { + private readonly IUmbracoContextAccessor _umbracoContextAccessor; + + public OutgoingEditorModelEventAttribute(IUmbracoContextAccessor umbracoContextAccessor) + { + _umbracoContextAccessor = umbracoContextAccessor; + } + + public override void OnActionExecuted(ActionExecutedContext context) + { + if (context.Result == null) return; + + var umbracoContext = _umbracoContextAccessor.GetRequiredUmbracoContext(); + var user = umbracoContext.Security.CurrentUser; + if (user == null) return; + + if (context.Result is ObjectResult objectContent) + { + var model = objectContent.Value; + + if (model != null) + { + var args = new EditorModelEventArgs( + model, + umbracoContext); + EditorModelEventManager.EmitEvent(context, args); + objectContent.Value = args.Model; + } + } + + base.OnActionExecuted(context); + } + + } +} diff --git a/src/Umbraco.Web.Common/Security/WebSecurity.cs b/src/Umbraco.Web.Common/Security/WebSecurity.cs index a52bc68cec..59b4826f46 100644 --- a/src/Umbraco.Web.Common/Security/WebSecurity.cs +++ b/src/Umbraco.Web.Common/Security/WebSecurity.cs @@ -1,9 +1,13 @@ using System; using System.Collections.Generic; using System.Text; +using Microsoft.AspNetCore.Http; using Umbraco.Composing; using Umbraco.Core; +using Umbraco.Core.Configuration; +using Umbraco.Core.Hosting; using Umbraco.Core.Models.Membership; +using Umbraco.Core.Services; using Umbraco.Web.Security; namespace Umbraco.Web.Common.Security @@ -12,10 +16,33 @@ namespace Umbraco.Web.Common.Security public class WebSecurity : IWebSecurity { - public IUser CurrentUser => new User(Current.Configs.Global()) - { + private readonly IUserService _userService; - }; + public WebSecurity(IUserService userService) + { + _userService = userService; + } + + private IUser _currentUser; + + /// + /// Gets the current user. + /// + /// The current user. + public IUser CurrentUser + { + get + { + //only load it once per instance! (but make sure groups are loaded) + if (_currentUser == null) + { + var id = GetUserId(); + _currentUser = id ? _userService.GetUserById(id.Result) : null; + } + + return _currentUser; + } + } public ValidateRequestAttempt AuthorizeRequest(bool throwExceptions = false) { diff --git a/src/Umbraco.Web.Common/UmbracoContext/UmbracoContextFactory.cs b/src/Umbraco.Web.Common/UmbracoContext/UmbracoContextFactory.cs index ac4b61909c..b2148ea5b3 100644 --- a/src/Umbraco.Web.Common/UmbracoContext/UmbracoContextFactory.cs +++ b/src/Umbraco.Web.Common/UmbracoContext/UmbracoContextFactory.cs @@ -72,7 +72,7 @@ namespace Umbraco.Web _variationContextAccessor.VariationContext = new VariationContext(_defaultCultureAccessor.DefaultCulture); } - IWebSecurity webSecurity = new WebSecurity(); + IWebSecurity webSecurity = new WebSecurity(_userService); return new UmbracoContext( _publishedSnapshotService, diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs index 605690444e..5b3a01052d 100644 --- a/src/Umbraco.Web/Editors/BackOfficeController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeController.cs @@ -182,67 +182,6 @@ namespace Umbraco.Web.Editors () => Redirect("/")); } - /// - /// Get the json localized text for a given culture or the culture for the current user - /// - /// - /// - /// Migrated already to .Net Core - [HttpGet] - public JsonNetResult LocalizedText(string culture = null) - { - var cultureInfo = string.IsNullOrWhiteSpace(culture) - //if the user is logged in, get their culture, otherwise default to 'en' - ? Security.IsAuthenticated() - //current culture is set at the very beginning of each request - ? Thread.CurrentThread.CurrentCulture - : CultureInfo.GetCultureInfo(GlobalSettings.DefaultUILanguage) - : CultureInfo.GetCultureInfo(culture); - - var allValues = Services.TextService.GetAllStoredValues(cultureInfo); - var pathedValues = allValues.Select(kv => - { - var slashIndex = kv.Key.IndexOf('/'); - var areaAlias = kv.Key.Substring(0, slashIndex); - var valueAlias = kv.Key.Substring(slashIndex+1); - return new - { - areaAlias, - valueAlias, - value = kv.Value - }; - }); - - Dictionary> nestedDictionary = pathedValues - .GroupBy(pv => pv.areaAlias) - .ToDictionary(pv => pv.Key, pv => - pv.ToDictionary(pve => pve.valueAlias, pve => pve.value)); - - return new JsonNetResult { Data = nestedDictionary, Formatting = Formatting.None }; - } - - /// - /// Returns the JavaScript main file including all references found in manifests - /// - /// - [MinifyJavaScriptResult(Order = 0)] - [OutputCache(Order = 1, VaryByParam = "none", Location = OutputCacheLocation.Server, Duration = 5000)] - public async Task Application() - { - var result = await _runtimeMinifier.GetScriptForLoadingBackOfficeAsync(GlobalSettings, _hostingEnvironment); - - return JavaScript(result); - } - - /// Migrated already to .Net Core - [UmbracoAuthorize(Order = 0)] - [HttpGet] - public JsonNetResult GetGridConfig() - { - return new JsonNetResult { Data = _gridConfig.EditorsConfig.Editors, Formatting = Formatting.None }; - } - - /// /// Returns the JavaScript object representing the static server variables javascript object diff --git a/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs b/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs index cf63fc2131..c94513684b 100644 --- a/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs +++ b/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs @@ -214,10 +214,11 @@ namespace Umbraco.Web.Editors "dataTypeApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl( controller => controller.GetById(0)) }, - { - "dashboardApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl( - controller => controller.GetDashboard(null)) - }, + //TODO Reintroduce + // { + // "dashboardApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl( + // controller => controller.GetDashboard(null)) + // }, { "logApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl( controller => controller.GetPagedEntityLog(0, 0, 0, Direction.Ascending, null)) @@ -310,10 +311,11 @@ namespace Umbraco.Web.Editors "helpApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl( controller => controller.GetContextHelpForPage("","","")) }, - { - "backOfficeAssetsApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl( - controller => controller.GetSupportedLocales()) - }, + //TODO Reintroduce + // { + // "backOfficeAssetsApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl( + // controller => controller.GetSupportedLocales()) + // }, { "languageApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl( controller => controller.GetAllLanguages()) diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 4858fafa4c..520b8845b6 100755 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -236,7 +236,6 @@ - @@ -350,7 +349,6 @@ -