mirror of
https://github.com/bitwarden/server.git
synced 2026-02-09 02:13:11 +08:00
* chore: remove fc refs in CreateGroup and UpdateGroup commands, refs AC-2646 * chore: remove fc refs and update interface to represent usage/get rid of double enumeration warnings, refs AC-2646 * chore: remove org/provider service fc callers, refs AC-2646 * chore: remove collection service fc callers, refs AC-2646 * chore: remove cipher service import ciphers fc callers, refs AC-2646 * fix: UpdateOrganizationUserCommandTests collections to list, refs AC-2646 * fix: update CreateGroupCommandTests, refs AC-2646 * fix: adjust UpdateGroupCommandTests, refs AC-2646 * fix: adjust UpdateOrganizationUserCommandTests for FC always true, refs AC-2646 * fix: update CollectionServiceTests, refs AC-2646 * fix: remove unnecessary test with fc disabled, refs AC-2646 * fix: update tests to account for AccessAll removal and Manager removal, refs AC-2646 * chore: remove dependence on FC flag for tests, refs AC-2646
50 lines
1.5 KiB
C#
50 lines
1.5 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using Bit.Core.Enums;
|
|
using Bit.Core.Models;
|
|
using Bit.Core.Models.Data;
|
|
using Bit.Core.Utilities;
|
|
|
|
#nullable enable
|
|
|
|
namespace Bit.Core.Entities;
|
|
|
|
public class OrganizationUser : ITableObject<Guid>, IExternal
|
|
{
|
|
public Guid Id { get; set; }
|
|
public Guid OrganizationId { get; set; }
|
|
public Guid? UserId { get; set; }
|
|
[MaxLength(256)]
|
|
public string? Email { get; set; }
|
|
public string? Key { get; set; }
|
|
public string? ResetPasswordKey { get; set; }
|
|
public OrganizationUserStatusType Status { get; set; }
|
|
public OrganizationUserType Type { get; set; }
|
|
|
|
/// <summary>
|
|
/// AccessAll is deprecated and should always be left as false. Scheduled for removal.
|
|
/// </summary>
|
|
public bool AccessAll { get; set; } = false;
|
|
[MaxLength(300)]
|
|
public string? ExternalId { get; set; }
|
|
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
|
|
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;
|
|
public string? Permissions { get; set; }
|
|
public bool AccessSecretsManager { get; set; }
|
|
|
|
public void SetNewId()
|
|
{
|
|
Id = CoreHelpers.GenerateComb();
|
|
}
|
|
|
|
public Permissions? GetPermissions()
|
|
{
|
|
return string.IsNullOrWhiteSpace(Permissions) ? null
|
|
: CoreHelpers.LoadClassFromJsonData<Permissions>(Permissions);
|
|
}
|
|
|
|
public void SetPermissions(Permissions permissions)
|
|
{
|
|
Permissions = CoreHelpers.ClassToJsonData(permissions);
|
|
}
|
|
}
|