1
0
mirror of https://github.com/bitwarden/server synced 2026-01-02 00:23:40 +00:00

[PM-22108] Add PolicyDetails_ReadByOrganizationId proc (#6019)

This commit is contained in:
Jimmy Vo
2025-07-31 11:24:39 -04:00
committed by GitHub
parent ff5659cc0f
commit de13932ffe
11 changed files with 589 additions and 4 deletions

View File

@@ -0,0 +1,6 @@
namespace Bit.Core.AdminConsole.Models.Data.Organizations.Policies;
public class OrganizationPolicyDetails : PolicyDetails
{
public Guid UserId { get; set; }
}

View File

@@ -31,4 +31,17 @@ public interface IPolicyRepository : IRepository<Policy, Guid>
/// You probably do not want to call it directly.
/// </remarks>
Task<IEnumerable<PolicyDetails>> GetPolicyDetailsByUserId(Guid userId);
/// <summary>
/// Retrieves <see cref="OrganizationPolicyDetails"/> of the specified <paramref name="policyType"/>
/// for users in the given organization and for any other organizations those users belong to.
/// </summary>
/// <remarks>
/// Each PolicyDetail represents an OrganizationUser and a Policy which *may* be enforced
/// against them. It only returns PolicyDetails for policies that are enabled and where the organization's plan
/// supports policies. It also excludes "revoked invited" users who are not subject to policy enforcement.
/// This is consumed by <see cref="IPolicyRequirementQuery"/> to create requirements for specific policy types.
/// You probably do not want to call it directly.
/// </remarks>
Task<IEnumerable<OrganizationPolicyDetails>> GetPolicyDetailsByOrganizationIdAsync(Guid organizationId, PolicyType policyType);
}