Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

1.0 KB
Raw Blame
using Grand.Domain;
using Grand.Domain.Customers;
using Grand.Domain.Permissions;
using Grand.Domain.Stores;

namespace Grand.Business.Core.Interfaces.Common.Security;

/// <summary>
///     ACL service interface
/// </summary>
public interface IAclService
{
    /// <summary>
    ///     Authorize ACL permission
    /// </summary>
    /// <typeparam name="T">Type</typeparam>
    /// <param name="entity">Entity</param>
    /// <param name="customer">Customer</param>
    /// <returns>true = authorized; otherwise = false</returns>
    bool Authorize<T>(T entity, Customer customer) where T : BaseEntity, IGroupLinkEntity;

    /// <summary>
    ///     Authorize whether entity could be accessed in a store
    /// </summary>
    /// <typeparam name="T">Type</typeparam>
    /// <param name="entity">Entity</param>
    /// <param name="storeId">Store identifier</param>
    /// <returns>true - authorized; otherwise, false</returns>
    bool Authorize<T>(T entity, string storeId) where T : BaseEntity, IStoreLinkEntity;
}