Add so only controllers are left

This commit is contained in:
Nikolaj Geisle
2022-03-31 14:39:44 +02:00
parent e3a21823b4
commit 0993f7b073
2 changed files with 4 additions and 4 deletions

View File

@@ -46,7 +46,7 @@ namespace Umbraco.Cms.Core.Security
char permissionToCheck) => CheckPermissions(content, user, new[] { permissionToCheck });
public ContentAccess CheckPermissions(
IContent content,
IContent? content,
IUser? user,
IReadOnlyList<char> permissionsToCheck)
{

View File

@@ -33,7 +33,7 @@ namespace Umbraco.Extensions
/// <summary>
/// Adds all required components to run the Umbraco back office
/// </summary>
public static IUmbracoBuilder AddBackOffice(this IUmbracoBuilder builder, Action<IMvcBuilder> configureMvc = null) => builder
public static IUmbracoBuilder AddBackOffice(this IUmbracoBuilder builder, Action<IMvcBuilder>? configureMvc = null) => builder
.AddConfiguration()
.AddUmbracoCore()
.AddWebComponents()
@@ -77,7 +77,7 @@ namespace Umbraco.Extensions
/// <summary>
/// Gets the back office tree collection builder
/// </summary>
public static TreeCollectionBuilder Trees(this IUmbracoBuilder builder)
public static TreeCollectionBuilder? Trees(this IUmbracoBuilder builder)
=> builder.WithCollectionBuilder<TreeCollectionBuilder>();
public static IUmbracoBuilder AddBackOfficeCore(this IUmbracoBuilder builder)
@@ -97,7 +97,7 @@ namespace Umbraco.Extensions
// the collection builder only accepts types inheriting from TreeControllerBase
// and will filter out those that are not attributed with TreeAttribute
var umbracoApiControllerTypes = builder.TypeLoader.GetUmbracoApiControllers().ToList();
builder.Trees()
builder.Trees()?
.AddTreeControllers(umbracoApiControllerTypes.Where(x => typeof(TreeControllerBase).IsAssignableFrom(x)));
builder.AddWebMappingProfiles();