using ZB.MOM.WW.ScadaBridge.Commons.Entities.Security; namespace ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; public interface ISecurityRepository { // LdapGroupMapping /// /// Gets an LDAP group mapping by ID. /// /// The mapping ID. /// A cancellation token that can be used to cancel the operation. /// The LDAP group mapping, or null if not found. Task GetMappingByIdAsync(int id, CancellationToken cancellationToken = default); /// /// Gets all LDAP group mappings. /// /// A cancellation token that can be used to cancel the operation. /// A read-only list of all LDAP group mappings. Task> GetAllMappingsAsync(CancellationToken cancellationToken = default); /// /// Gets all LDAP group mappings for a specific role. /// /// The role name. /// A cancellation token that can be used to cancel the operation. /// A read-only list of LDAP group mappings for the role. Task> GetMappingsByRoleAsync(string role, CancellationToken cancellationToken = default); /// /// Adds a new LDAP group mapping. /// /// The LDAP group mapping to add. /// A cancellation token that can be used to cancel the operation. /// A task representing the asynchronous operation. Task AddMappingAsync(LdapGroupMapping mapping, CancellationToken cancellationToken = default); /// /// Updates an existing LDAP group mapping. /// /// The LDAP group mapping to update. /// A cancellation token that can be used to cancel the operation. /// A task representing the asynchronous operation. Task UpdateMappingAsync(LdapGroupMapping mapping, CancellationToken cancellationToken = default); /// /// Deletes an LDAP group mapping by ID. /// /// The mapping ID to delete. /// A cancellation token that can be used to cancel the operation. /// A task representing the asynchronous operation. Task DeleteMappingAsync(int id, CancellationToken cancellationToken = default); // SiteScopeRule /// /// Gets a site scope rule by ID. /// /// The scope rule ID. /// A cancellation token that can be used to cancel the operation. /// The site scope rule, or null if not found. Task GetScopeRuleByIdAsync(int id, CancellationToken cancellationToken = default); /// /// Gets all site scope rules for an LDAP group mapping. /// /// The LDAP group mapping ID. /// A cancellation token that can be used to cancel the operation. /// A read-only list of scope rules for the mapping. Task> GetScopeRulesForMappingAsync(int ldapGroupMappingId, CancellationToken cancellationToken = default); /// /// Adds a new site scope rule. /// /// The site scope rule to add. /// A cancellation token that can be used to cancel the operation. /// A task representing the asynchronous operation. Task AddScopeRuleAsync(SiteScopeRule rule, CancellationToken cancellationToken = default); /// /// Updates an existing site scope rule. /// /// The site scope rule to update. /// A cancellation token that can be used to cancel the operation. /// A task representing the asynchronous operation. Task UpdateScopeRuleAsync(SiteScopeRule rule, CancellationToken cancellationToken = default); /// /// Deletes a site scope rule by ID. /// /// The scope rule ID to delete. /// A cancellation token that can be used to cancel the operation. /// A task representing the asynchronous operation. Task DeleteScopeRuleAsync(int id, CancellationToken cancellationToken = default); /// /// Saves all pending changes to the database. /// /// A cancellation token that can be used to cancel the operation. /// A task representing the number of entities saved. Task SaveChangesAsync(CancellationToken cancellationToken = default); }