1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-20 08:57:07 -05:00

Wrong business logic checking for invalid permissions.

This commit is contained in:
Jonas Hendrickx
2025-03-26 15:01:32 +01:00
parent f6143b12d6
commit 990df5ef6a

View File

@ -28,10 +28,10 @@ public class CreateAdminInitiatedSponsorshipHandler(
OrganizationUserType[] allowedUserTypes = OrganizationUserType[] allowedUserTypes =
[ [
OrganizationUserType.Admin, OrganizationUserType.Admin,
OrganizationUserType.Owner, OrganizationUserType.Owner
OrganizationUserType.Custom
]; ];
if (!organization.Permissions.ManageUsers || allowedUserTypes.All(x => x != organization.Type))
if (!organization.Permissions.ManageUsers && allowedUserTypes.All(x => x != organization.Type))
{ {
throw new UnauthorizedAccessException("You do not have permissions to send sponsorships on behalf of the organization."); throw new UnauthorizedAccessException("You do not have permissions to send sponsorships on behalf of the organization.");
} }