Merge remote-tracking branch 'origin/netcore/netcore' into netcore/task/6666-auth-policies

# Conflicts:
#	src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs
#	src/Umbraco.Web.Common/Filters/UmbracoMemberAuthorizeFilter.cs
This commit is contained in:
Shannon
2020-11-24 00:46:38 +11:00
50 changed files with 699 additions and 368 deletions

View File

@@ -3,17 +3,19 @@ using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Umbraco.Core;
using Umbraco.Core.BackOffice;
using Umbraco.Core.Configuration.Models;
using Umbraco.Core.Mapping;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Models.Security;
using Umbraco.Core.Security;
using Umbraco.Core.Services;
using Umbraco.Extensions;
@@ -25,11 +27,10 @@ using Umbraco.Web.Common.Controllers;
using Umbraco.Web.Common.Exceptions;
using Umbraco.Web.Common.Filters;
using Umbraco.Web.Common.Security;
using Umbraco.Web.Editors.Filters;
using Umbraco.Web.Models;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Security;
using Constants = Umbraco.Core.Constants;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Authorization;
using Umbraco.Web.Common.Authorization;

View File

@@ -250,7 +250,7 @@ namespace Umbraco.Web.BackOffice.Controllers
/// <param name="culture">The culture to fetch the URL for</param>
/// <returns>The URL or path to the item</returns>
[DetermineAmbiguousActionByPassingParameters]
public HttpResponseMessage GetUrl(Udi udi, string culture = "*")
public IActionResult GetUrl(Udi udi, string culture = "*")
{
var intId = _entityService.GetId(udi);
if (!intId.Success)
@@ -284,7 +284,7 @@ namespace Umbraco.Web.BackOffice.Controllers
/// We are not restricting this with security because there is no sensitive data
/// </remarks>
[DetermineAmbiguousActionByPassingParameters]
public HttpResponseMessage GetUrl(int id, UmbracoEntityTypes type, string culture = null)
public IActionResult GetUrl(int id, UmbracoEntityTypes type, string culture = null)
{
culture = culture ?? ClientCulture();
@@ -297,10 +297,7 @@ namespace Umbraco.Web.BackOffice.Controllers
{
returnUrl = foundUrl;
return new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new StringContent(returnUrl)
};
return Ok(returnUrl);
}
}
@@ -314,10 +311,7 @@ namespace Umbraco.Web.BackOffice.Controllers
returnUrl = "/" + string.Join("/", ancestors.Select(x => x.Name));
return new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new StringContent(returnUrl)
};
return Ok(returnUrl);
}

View File

@@ -157,7 +157,7 @@ namespace Umbraco.Web.BackOffice.Controllers
}
[HttpPost]
public HttpResponseMessage CreatePartialViewMacroWithFile(CreatePartialViewMacroWithFileModel model)
public IActionResult CreatePartialViewMacroWithFile(CreatePartialViewMacroWithFileModel model)
{
if (model == null) throw new ArgumentNullException("model");
if (string.IsNullOrWhiteSpace(model.Filename)) throw new ArgumentException("Filename cannot be null or whitespace", "model.Filename");
@@ -173,7 +173,7 @@ namespace Umbraco.Web.BackOffice.Controllers
};
_macroService.Save(macro); // may throw
return new HttpResponseMessage(HttpStatusCode.OK);
return Ok();
}
public class CreatePartialViewMacroWithFileModel