mirror of
https://github.com/bitwarden/server.git
synced 2025-04-21 04:55:08 -05:00
Merge branch 'experiment/authorize-attribute' of https://github.com/bitwarden/server into experiment/authorize-attribute
This commit is contained in:
commit
336228e3b4
@ -10,8 +10,11 @@ public class ManageUsersRequirement : IOrganizationRequirement
|
||||
public async Task<bool> AuthorizeAsync(
|
||||
CurrentContextOrganization? organizationClaims,
|
||||
Func<Task<bool>> isProviderUserForOrg)
|
||||
=> organizationClaims is
|
||||
{ Type: OrganizationUserType.Owner or OrganizationUserType.Admin } or
|
||||
{ Permissions.ManageUsers: true }
|
||||
|| await isProviderUserForOrg();
|
||||
=> organizationClaims switch
|
||||
{
|
||||
{ Type: OrganizationUserType.Owner } => true,
|
||||
{ Type: OrganizationUserType.Admin } => true,
|
||||
{ Permissions.ManageUsers: true } => true,
|
||||
_ => await isProviderUserForOrg()
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user