mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
Permissions bugs (#1083)
* Null checked org invite collections * Null checked permissions on org invite * Gave a static seat count to org invite fixture * Null checked the right way
This commit is contained in:
@ -20,7 +20,7 @@ namespace Bit.Core.Models.Business
|
||||
Emails = requestModel.Emails;
|
||||
Type = requestModel.Type.Value;
|
||||
AccessAll = requestModel.AccessAll;
|
||||
Collections = requestModel.Collections.Select(c => c.ToSelectionReadOnly());
|
||||
Collections = requestModel.Collections?.Select(c => c.ToSelectionReadOnly());
|
||||
Permissions = requestModel.Permissions;
|
||||
}
|
||||
}
|
||||
|
@ -1022,11 +1022,15 @@ namespace Bit.Core.Services
|
||||
ExternalId = externalId,
|
||||
CreationDate = DateTime.UtcNow,
|
||||
RevisionDate = DateTime.UtcNow,
|
||||
Permissions = System.Text.Json.JsonSerializer.Serialize(invite.Permissions, new JsonSerializerOptions
|
||||
};
|
||||
|
||||
if (invite.Permissions != null)
|
||||
{
|
||||
orgUser.Permissions = System.Text.Json.JsonSerializer.Serialize(invite.Permissions, new JsonSerializerOptions
|
||||
{
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||
}),
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
if (!orgUser.AccessAll && invite.Collections.Any())
|
||||
{
|
||||
|
Reference in New Issue
Block a user