using Nop.Core;
using Nop.Core.Domain.Customers;
using Nop.Core.Domain.Security;
namespace Nop.Services.Security;
///
/// ACL service interface
///
public partial interface IAclService
{
///
/// Apply ACL to the passed query
///
/// Type of entity that supports the ACL
/// Query to filter
/// Customer
///
/// A task that represents the asynchronous operation
/// The task result contains the filtered query
///
Task> ApplyAcl(IQueryable query, Customer customer) where TEntity : BaseEntity, IAclSupported;
///
/// Apply ACL to the passed query
///
/// Type of entity that supports the ACL
/// Query to filter
/// Identifiers of customer's roles
///
/// A task that represents the asynchronous operation
/// The task result contains the filtered query
///
Task> ApplyAcl(IQueryable query, int[] customerRoleIds) where TEntity : BaseEntity, IAclSupported;
///
/// Deletes an ACL record
///
/// ACL record
/// A task that represents the asynchronous operation
Task DeleteAclRecordAsync(AclRecord aclRecord);
///
/// Gets ACL records
///
/// Type of entity that supports the ACL
/// Entity
///
/// A task that represents the asynchronous operation
/// The task result contains the ACL records
///
Task> GetAclRecordsAsync(TEntity entity) where TEntity : BaseEntity, IAclSupported;
///
/// Inserts an ACL record
///
/// Type of entity that supports the ACL
/// Entity
/// Customer role id
/// A task that represents the asynchronous operation
Task InsertAclRecordAsync(TEntity entity, int customerRoleId) where TEntity : BaseEntity, IAclSupported;
///
/// Find customer role identifiers with granted access
///
/// Entity ID
/// Entity name
///
/// A task that represents the asynchronous operation
/// The task result contains the customer role identifiers
///
Task GetCustomerRoleIdsWithAccessAsync(int entityId, string entityName);
///
/// Authorize ACL permission
///
/// Type of entity that supports the ACL
/// Entity
///
/// A task that represents the asynchronous operation
/// The task result contains true - authorized; otherwise, false
///
Task AuthorizeAsync(TEntity entity) where TEntity : BaseEntity, IAclSupported;
///
/// Authorize ACL permission
///
/// Type of entity that supports the ACL
/// Entity
/// Customer
///
/// A task that represents the asynchronous operation
/// The task result contains true - authorized; otherwise, false
///
Task AuthorizeAsync(TEntity entity, Customer customer) where TEntity : BaseEntity, IAclSupported;
///
/// Authorize ACL permission
///
/// Type name of entity that supports the ACL
/// Entity ID
/// Customer
///
/// A task that represents the asynchronous operation
/// The task result contains true - authorized; otherwise, false
///
Task AuthorizeAsync(string entityTypeName, int entityId, Customer customer);
///
/// Authorize ACL permission
///
/// Customer
/// List of allowed customer role IDs
///
/// A task that represents the asynchronous operation
/// The task result contains true - authorized; otherwise, false
///
Task AuthorizeAsync(Customer customer, IList allowedCustomerRoleIds);
///
/// Save ACL mapping
///
/// Type of entity
/// Entity
/// Customer roles for mapping
/// A task that represents the asynchronous operation
Task SaveAclAsync(TEntity entity, IList selectedCustomerRoleIds) where TEntity : BaseEntity, IAclSupported;
}