diff --git a/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs b/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs index d49f4386e2..788efca03b 100644 --- a/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs +++ b/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs @@ -146,7 +146,7 @@ public class OrganizationUsersController : Controller } [HttpGet("")] - [OrganizationAuthorize(typeof(ManageUsersRequirement))] + [OrganizationAuthorize] public async Task> Get(Guid orgId, bool includeGroups = false, bool includeCollections = false) { var organizationUsers = await _organizationUserUserDetailsQuery.GetOrganizationUserUserDetails( diff --git a/src/Core/AdminConsole/OrganizationFeatures/Shared/Authorization/OrganizationAuthorizeAttribute.cs b/src/Core/AdminConsole/OrganizationFeatures/Shared/Authorization/OrganizationAuthorizeAttribute.cs index f018313891..79bb6bbd06 100644 --- a/src/Core/AdminConsole/OrganizationFeatures/Shared/Authorization/OrganizationAuthorizeAttribute.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/Shared/Authorization/OrganizationAuthorizeAttribute.cs @@ -2,12 +2,13 @@ namespace Bit.Core.AdminConsole.OrganizationFeatures.Shared.Authorization; -public class OrganizationAuthorizeAttribute(Type requirementType) +public class OrganizationAuthorizeAttribute : AuthorizeAttribute, IAuthorizationRequirementData + where T : IOrganizationRequirement, new() { public IEnumerable GetRequirements() { - var requirement = (IOrganizationRequirement)Activator.CreateInstance(requirementType)!; + var requirement = new T(); yield return requirement; } }