// Copyright (c) Umbraco.
// See LICENSE for more details.
using System.Collections.Generic;
using Umbraco.Core.Models;
namespace Umbraco.Web.BackOffice.Authorization
{
///
/// The resource used for the
///
public class ContentPermissionsResource
{
///
/// Initializes a new instance of the class.
///
/// The content.
/// The permission to authorize.
public ContentPermissionsResource(IContent content, char permissionToCheck)
{
PermissionsToCheck = new List { permissionToCheck };
Content = content;
}
///
/// Initializes a new instance of the class.
///
/// The content.
/// The collection of permissions to authorize.
public ContentPermissionsResource(IContent content, IReadOnlyList permissionsToCheck)
{
Content = content;
PermissionsToCheck = permissionsToCheck;
}
///
/// Initializes a new instance of the class.
///
/// The content.
/// The node Id.
/// The collection of permissions to authorize.
public ContentPermissionsResource(IContent content, int nodeId, IReadOnlyList permissionsToCheck)
{
Content = content;
NodeId = nodeId;
PermissionsToCheck = permissionsToCheck;
}
///
/// Gets the node Id.
///
public int? NodeId { get; }
///
/// Gets the collection of permissions to authorize.
///
public IReadOnlyList PermissionsToCheck { get; }
///
/// Gets the content.
///
public IContent Content { get; }
}
}