diff --git a/src/Api/AdminConsole/Authorization/IOrganizationRequirement.cs b/src/Api/AdminConsole/Authorization/IOrganizationRequirement.cs
index 0031de660b..007647f4c0 100644
--- a/src/Api/AdminConsole/Authorization/IOrganizationRequirement.cs
+++ b/src/Api/AdminConsole/Authorization/IOrganizationRequirement.cs
@@ -13,6 +13,18 @@ namespace Bit.Api.AdminConsole.Authorization;
///
public interface IOrganizationRequirement : IAuthorizationRequirement
{
+ ///
+ /// Whether to authorize a request that has this requirement.
+ ///
+ ///
+ /// The CurrentContextOrganization for the user if they are a member of the organization.
+ /// This is null if they are not a member.
+ ///
+ ///
+ /// A callback that returns true if the user is a ProviderUser that manages the organization, otherwise false.
+ /// This requires a database query, call it last.
+ ///
+ /// True if the requirement has been satisfied, otherwise false.
public Task AuthorizeAsync(
CurrentContextOrganization? organizationClaims,
Func> isProviderUserForOrg);
diff --git a/src/Api/AdminConsole/Authorization/ProviderOrganizationHttpContextFeature.cs b/src/Api/AdminConsole/Authorization/ProviderOrganizationHttpContextFeature.cs
index efd1cb54c1..9da9834ea0 100644
--- a/src/Api/AdminConsole/Authorization/ProviderOrganizationHttpContextFeature.cs
+++ b/src/Api/AdminConsole/Authorization/ProviderOrganizationHttpContextFeature.cs
@@ -6,6 +6,14 @@ namespace Bit.Api.AdminConsole.Authorization;
public static class ProviderOrganizationHttpContextFeature
{
+ ///
+ /// Returns the ProviderUserOrganizations for a user. These are the organizations the ProviderUser manages via their Provider, if any.
+ /// This data is fetched from the database and cached as a HttpContext Feature for the lifetime of the request.
+ ///
+ ///
+ ///
+ ///
+ ///
private static async Task> GetProviderUserOrganizationsAsync(
this HttpContext httpContext,
IProviderUserRepository providerUserRepository,
@@ -24,6 +32,10 @@ public static class ProviderOrganizationHttpContextFeature
return providerUserOrganizations;
}
+ ///
+ /// Returns true if the user is a ProviderUser for a Provider which manages the specified organization, otherwise false.
+ /// This data is fetched from the database and cached as a HttpContext Feature for the lifetime of the request.
+ ///
public static async Task IsProviderUserForOrgAsync(
this HttpContext httpContext,
IProviderUserRepository providerUserRepository,