mirror of
https://github.com/bitwarden/server.git
synced 2026-02-17 06:13:12 +08:00
events for collections, groups, and org users
This commit is contained in:
@@ -1,32 +1,22 @@
|
||||
using System;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Models.Table;
|
||||
using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Core.Models.Data
|
||||
{
|
||||
public class OrganizationEvent : EventTableEntity
|
||||
{
|
||||
public OrganizationEvent(Guid organizationId, EventType type)
|
||||
public OrganizationEvent(Organization organization, Guid actingUserId, EventType type)
|
||||
{
|
||||
OrganizationId = organizationId;
|
||||
OrganizationId = organization.Id;
|
||||
Type = (int)type;
|
||||
ActingUserId = actingUserId;
|
||||
|
||||
Timestamp = DateTime.UtcNow;
|
||||
PartitionKey = $"OrganizationId={OrganizationId}";
|
||||
RowKey = string.Format("Date={0}__Type={1}",
|
||||
CoreHelpers.DateTimeToTableStorageKey(Timestamp.DateTime), Type);
|
||||
}
|
||||
|
||||
public OrganizationEvent(Guid organizationId, Guid userId, EventType type)
|
||||
{
|
||||
OrganizationId = organizationId;
|
||||
UserId = userId;
|
||||
Type = (int)type;
|
||||
|
||||
Timestamp = DateTime.UtcNow;
|
||||
PartitionKey = $"OrganizationId={OrganizationId}";
|
||||
RowKey = string.Format("Date={0}__UserId={1}__Type={2}",
|
||||
CoreHelpers.DateTimeToTableStorageKey(Timestamp.DateTime), UserId, Type);
|
||||
RowKey = string.Format("Date={0}__ActingUserId={1}__Type={2}",
|
||||
CoreHelpers.DateTimeToTableStorageKey(Timestamp.DateTime), ActingUserId, Type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user