mirror of
https://github.com/bitwarden/server.git
synced 2025-04-04 20:50:21 -05:00

* move remaining Organization domain files * namespaces will be updated in a separate commit
29 lines
1.1 KiB
C#
29 lines
1.1 KiB
C#
using Bit.Core.Enums;
|
|
using Bit.Core.Models.Data;
|
|
using Bit.Core.Models.Data.Organizations.OrganizationUsers;
|
|
using Bit.Core.Utilities;
|
|
|
|
namespace Bit.Core.Context;
|
|
|
|
public class CurrentContextOrganization
|
|
{
|
|
public CurrentContextOrganization() { }
|
|
|
|
public CurrentContextOrganization(OrganizationUserOrganizationDetails orgUser)
|
|
{
|
|
Id = orgUser.OrganizationId;
|
|
Type = orgUser.Type;
|
|
Permissions = CoreHelpers.LoadClassFromJsonData<Permissions>(orgUser.Permissions);
|
|
AccessSecretsManager = orgUser.AccessSecretsManager && orgUser.UseSecretsManager && orgUser.Enabled;
|
|
LimitCollectionCreationDeletion = orgUser.LimitCollectionCreationDeletion;
|
|
AllowAdminAccessToAllCollectionItems = orgUser.AllowAdminAccessToAllCollectionItems;
|
|
}
|
|
|
|
public Guid Id { get; set; }
|
|
public OrganizationUserType Type { get; set; }
|
|
public Permissions Permissions { get; set; } = new();
|
|
public bool AccessSecretsManager { get; set; }
|
|
public bool LimitCollectionCreationDeletion { get; set; }
|
|
public bool AllowAdminAccessToAllCollectionItems { get; set; }
|
|
}
|