2020-12-06 09:13:29 +01:00
|
|
|
// Copyright (c) Umbraco.
|
|
|
|
|
// See LICENSE for more details.
|
|
|
|
|
|
2020-11-19 22:17:42 +11:00
|
|
|
using System.Collections.Generic;
|
2020-12-06 09:13:29 +01:00
|
|
|
using Microsoft.AspNetCore.Authorization;
|
2020-11-19 22:17:42 +11:00
|
|
|
|
2021-02-18 11:06:02 +01:00
|
|
|
namespace Umbraco.Cms.Web.BackOffice.Authorization
|
2020-11-19 22:17:42 +11:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
2020-11-23 22:43:41 +11:00
|
|
|
/// Authorization requirements for <see cref="SectionHandler"/>
|
2020-11-19 22:17:42 +11:00
|
|
|
/// </summary>
|
2020-11-23 22:43:41 +11:00
|
|
|
public class SectionRequirement : IAuthorizationRequirement
|
2020-11-19 22:17:42 +11:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
2020-12-06 09:13:29 +01:00
|
|
|
/// Initializes a new instance of the <see cref="SectionRequirement"/> class.
|
2020-11-19 22:17:42 +11:00
|
|
|
/// </summary>
|
2020-12-06 09:13:29 +01:00
|
|
|
/// <param name="aliases">Aliases for sections that the user will need access to.</param>
|
2020-11-23 22:43:41 +11:00
|
|
|
public SectionRequirement(params string[] aliases) => SectionAliases = aliases;
|
2020-12-06 09:13:29 +01:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the aliases for sections that the user will need access to.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public IReadOnlyCollection<string> SectionAliases { get; }
|
2020-11-19 22:17:42 +11:00
|
|
|
}
|
|
|
|
|
}
|