1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-02 13:53:23 +01:00

Tweak comments

This commit is contained in:
Thomas Rittson 2024-10-07 13:01:58 +10:00
parent 5c7d47402d
commit bc419a49bd
No known key found for this signature in database
GPG Key ID: CDDDA03861C35E27

View File

@ -5,22 +5,26 @@ using Bit.Core.AdminConsole.Enums;
namespace Bit.Core.AdminConsole.OrganizationFeatures.Policies;
/// <summary>
/// Defines behavior and functionality for a given PolicyType.
/// </summary>
public interface IPolicyDefinition
{
/// <summary>
/// The PolicyType that the strategy is responsible for handling.
/// The PolicyType that this definition relates to.
/// </summary>
public PolicyType Type { get; }
/// <summary>
/// PolicyTypes that must be enabled before this policy can be enabled, if any.
/// These dependencies will be checked when this policy is enabled and when any required policy is disabled.
/// </summary>
public IEnumerable<PolicyType> RequiredPolicies => [];
/// <summary>
/// Validates a policy before saving it.
/// Basic interdependencies between policies are already handled by the <see cref="RequiredPolicies"/> definition.
/// Use this for additional or more complex validation, if any.
/// Do not use this for simple dependencies between different policies - see <see cref="RequiredPolicies"/> instead.
/// Implementation is optional; by default it will not perform any validation.
/// </summary>
/// <param name="currentPolicy">The current policy, if any</param>
/// <param name="modifiedPolicy">The modified policy to be saved</param>
@ -28,8 +32,9 @@ public interface IPolicyDefinition
public Task<string?> ValidateAsync(Policy? currentPolicy, Policy modifiedPolicy) => Task.FromResult<string?>(null);
/// <summary>
/// Optionally performs side effects after a policy is validated but before it is saved.
/// Performs side effects after a policy is validated but before it is saved.
/// For example, this can be used to remove non-compliant users from the organization.
/// Implementation is optional; by default it will not perform any side effects.
/// </summary>
/// <param name="currentPolicy">The current policy, if any</param>
/// <param name="modifiedPolicy">The modified policy to be saved</param>