using Nop.Core.Domain.Customers; using Nop.Core.Domain.Security; namespace Nop.Services.Security; /// /// Permission service interface /// public partial interface IPermissionService { /// /// Gets all permissions /// /// /// A task that represents the asynchronous operation /// The task result contains the permissions /// Task> GetAllPermissionRecordsAsync(); /// /// Inserts a permission /// /// Permission /// A task that represents the asynchronous operation Task InsertPermissionRecordAsync(PermissionRecord permission); /// /// Gets a permission record by identifier /// /// Permission identifier /// /// A task that represents the asynchronous operation /// The task result contains a permission record /// Task GetPermissionRecordByIdAsync(int permissionId); /// /// Updates the permission /// /// Permission /// A task that represents the asynchronous operation Task UpdatePermissionRecordAsync(PermissionRecord permission); /// /// Deletes the permission /// /// Permission /// A task that represents the asynchronous operation Task DeletePermissionRecordAsync(PermissionRecord permission); /// /// Delete a permission /// /// Permission system name /// A task that represents the asynchronous operation Task DeletePermissionAsync(string permissionSystemName); /// /// Authorize permission /// /// Permission record /// /// A task that represents the asynchronous operation /// The task result contains true - authorized; otherwise, false /// Task AuthorizeAsync(PermissionRecord permission); /// /// Authorize permission /// /// Permission record /// Customer /// /// A task that represents the asynchronous operation /// The task result contains true - authorized; otherwise, false /// Task AuthorizeAsync(PermissionRecord permission, Customer customer); /// /// Authorize permission /// /// Permission record system name /// /// A task that represents the asynchronous operation /// The task result contains true - authorized; otherwise, false /// Task AuthorizeAsync(string permissionRecordSystemName); /// /// Authorize permission /// /// Permission record system name /// Customer /// /// A task that represents the asynchronous operation /// The task result contains true - authorized; otherwise, false /// Task AuthorizeAsync(string permissionRecordSystemName, Customer customer); /// /// Authorize permission /// /// Permission record system name /// Customer role identifier /// /// A task that represents the asynchronous operation /// The task result contains true - authorized; otherwise, false /// Task AuthorizeAsync(string permissionRecordSystemName, int customerRoleId); /// /// Gets a permission record-customer role mapping /// /// Permission identifier /// /// A task that represents the asynchronous operation /// The task result contains a list of mappings /// Task> GetMappingByPermissionRecordIdAsync(int permissionId); /// /// Delete a permission record-customer role mapping /// /// Permission identifier /// Customer role identifier /// A task that represents the asynchronous operation Task DeletePermissionRecordCustomerRoleMappingAsync(int permissionId, int customerRoleId); /// /// Inserts a permission record-customer role mapping /// /// Permission record-customer role mapping /// A task that represents the asynchronous operation Task InsertPermissionRecordCustomerRoleMappingAsync(PermissionRecordCustomerRoleMapping permissionRecordCustomerRoleMapping); /// /// Insert permissions /// /// A task that represents the asynchronous operation Task InsertPermissionsAsync(); /// /// Inserts a permission record-customer role mappings /// /// Customer role ID /// Permissions /// A task that represents the asynchronous operation Task InsertPermissionMappingAsync(int customerRoleId, params string[] permissions); }