mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 16:42:50 -05:00
rename AccessAllCollections => AccessAll
This commit is contained in:
@ -12,7 +12,7 @@ namespace Bit.Core.Models.Api
|
||||
public string Email { get; set; }
|
||||
[Required]
|
||||
public Enums.OrganizationUserType? Type { get; set; }
|
||||
public bool AccessAllCollections { get; set; }
|
||||
public bool AccessAll { get; set; }
|
||||
public IEnumerable<OrganizationUserCollectionRequestModel> Collections { get; set; }
|
||||
}
|
||||
|
||||
@ -32,13 +32,13 @@ namespace Bit.Core.Models.Api
|
||||
{
|
||||
[Required]
|
||||
public Enums.OrganizationUserType? Type { get; set; }
|
||||
public bool AccessAllCollections { get; set; }
|
||||
public bool AccessAll { get; set; }
|
||||
public IEnumerable<OrganizationUserCollectionRequestModel> Collections { get; set; }
|
||||
|
||||
public OrganizationUser ToOrganizationUser(OrganizationUser existingUser)
|
||||
{
|
||||
existingUser.Type = Type.Value;
|
||||
existingUser.AccessAllCollections = AccessAllCollections;
|
||||
existingUser.AccessAll = AccessAll;
|
||||
return existingUser;
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ namespace Bit.Core.Models.Api
|
||||
Id = collectionUser.Id?.ToString();
|
||||
OrganizationUserId = collectionUser.OrganizationUserId.ToString();
|
||||
CollectionId = collectionUser.CollectionId?.ToString();
|
||||
AccessAllCollections = collectionUser.AccessAllCollections;
|
||||
AccessAll = collectionUser.AccessAll;
|
||||
Name = collectionUser.Name;
|
||||
Email = collectionUser.Email;
|
||||
Type = collectionUser.Type;
|
||||
@ -29,7 +29,7 @@ namespace Bit.Core.Models.Api
|
||||
public string Id { get; set; }
|
||||
public string OrganizationUserId { get; set; }
|
||||
public string CollectionId { get; set; }
|
||||
public bool AccessAllCollections { get; set; }
|
||||
public bool AccessAll { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Email { get; set; }
|
||||
public OrganizationUserType Type { get; set; }
|
||||
|
@ -22,7 +22,7 @@ namespace Bit.Core.Models.Api
|
||||
Email = organizationUser.Email;
|
||||
Type = organizationUser.Type;
|
||||
Status = organizationUser.Status;
|
||||
AccessAllCollections = organizationUser.AccessAllCollections;
|
||||
AccessAll = organizationUser.AccessAll;
|
||||
}
|
||||
|
||||
public string Id { get; set; }
|
||||
@ -31,7 +31,7 @@ namespace Bit.Core.Models.Api
|
||||
public string Email { get; set; }
|
||||
public OrganizationUserType Type { get; set; }
|
||||
public OrganizationUserStatusType Status { get; set; }
|
||||
public bool AccessAllCollections { get; set; }
|
||||
public bool AccessAll { get; set; }
|
||||
}
|
||||
|
||||
public class OrganizationUserDetailsResponseModel : OrganizationUserResponseModel
|
||||
|
@ -7,7 +7,7 @@ namespace Bit.Core.Models.Data
|
||||
public Guid? Id { get; set; }
|
||||
public Guid OrganizationUserId { get; set; }
|
||||
public Guid? CollectionId { get; set; }
|
||||
public bool AccessAllCollections { get; set; }
|
||||
public bool AccessAll { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Email { get; set; }
|
||||
public Enums.OrganizationUserStatusType Status { get; set; }
|
||||
|
@ -11,6 +11,6 @@ namespace Bit.Core.Models.Data
|
||||
public string Email { get; set; }
|
||||
public Enums.OrganizationUserStatusType Status { get; set; }
|
||||
public Enums.OrganizationUserType Type { get; set; }
|
||||
public bool AccessAllCollections { get; set; }
|
||||
public bool AccessAll { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ namespace Bit.Core.Models.Table
|
||||
public string Key { get; set; }
|
||||
public OrganizationUserStatusType Status { get; set; }
|
||||
public OrganizationUserType Type { get; set; }
|
||||
public bool AccessAllCollections { get; set; }
|
||||
public bool AccessAll { get; set; }
|
||||
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
|
||||
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace Bit.Core.Services
|
||||
Task EnableAsync(Guid organizationId);
|
||||
Task UpdateAsync(Organization organization, bool updateBilling = false);
|
||||
Task<OrganizationUser> InviteUserAsync(Guid organizationId, Guid invitingUserId, string email,
|
||||
Enums.OrganizationUserType type, bool accessAllCollections, IEnumerable<CollectionUser> collections);
|
||||
OrganizationUserType type, bool accessAll, IEnumerable<CollectionUser> collections);
|
||||
Task ResendInviteAsync(Guid organizationId, Guid invitingUserId, Guid organizationUserId);
|
||||
Task<OrganizationUser> AcceptUserAsync(Guid organizationUserId, User user, string token);
|
||||
Task<OrganizationUser> ConfirmUserAsync(Guid organizationId, Guid organizationUserId, string key, Guid confirmingUserId);
|
||||
|
@ -570,7 +570,7 @@ namespace Bit.Core.Services
|
||||
Key = signup.OwnerKey,
|
||||
Type = OrganizationUserType.Owner,
|
||||
Status = OrganizationUserStatusType.Confirmed,
|
||||
AccessAllCollections = true,
|
||||
AccessAll = true,
|
||||
CreationDate = DateTime.UtcNow,
|
||||
RevisionDate = DateTime.UtcNow
|
||||
};
|
||||
@ -672,7 +672,7 @@ namespace Bit.Core.Services
|
||||
}
|
||||
|
||||
public async Task<OrganizationUser> InviteUserAsync(Guid organizationId, Guid invitingUserId, string email,
|
||||
OrganizationUserType type, bool accessAllCollections, IEnumerable<CollectionUser> collections)
|
||||
OrganizationUserType type, bool accessAll, IEnumerable<CollectionUser> collections)
|
||||
{
|
||||
var organization = await _organizationRepository.GetByIdAsync(organizationId);
|
||||
if(organization == null)
|
||||
@ -705,13 +705,13 @@ namespace Bit.Core.Services
|
||||
Key = null,
|
||||
Type = type,
|
||||
Status = OrganizationUserStatusType.Invited,
|
||||
AccessAllCollections = accessAllCollections,
|
||||
AccessAll = accessAll,
|
||||
CreationDate = DateTime.UtcNow,
|
||||
RevisionDate = DateTime.UtcNow
|
||||
};
|
||||
|
||||
await _organizationUserRepository.CreateAsync(orgUser);
|
||||
if(!orgUser.AccessAllCollections && collections.Any())
|
||||
if(!orgUser.AccessAll && collections.Any())
|
||||
{
|
||||
await SaveUserCollectionsAsync(orgUser, collections, true);
|
||||
}
|
||||
@ -835,7 +835,7 @@ namespace Bit.Core.Services
|
||||
|
||||
await _organizationUserRepository.ReplaceAsync(user);
|
||||
|
||||
if(user.AccessAllCollections)
|
||||
if(user.AccessAll)
|
||||
{
|
||||
// We don't need any collections if we're flagged to have all access.
|
||||
collections = new List<CollectionUser>();
|
||||
|
Reference in New Issue
Block a user