1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-24 17:17:40 +01:00

group external id

This commit is contained in:
Kyle Spearrin 2017-05-12 14:02:33 -04:00
parent 5a6e189e67
commit 5d595d4cf9
8 changed files with 15 additions and 2 deletions

View File

@ -13,6 +13,7 @@ namespace Bit.Core.Models.Api
public string Name { get; set; }
[Required]
public bool? AccessAll { get; set; }
public string ExternalId { get; set; }
public IEnumerable<SelectionReadOnlyRequestModel> Collections { get; set; }
public Group ToGroup(Guid orgId)
@ -27,6 +28,7 @@ namespace Bit.Core.Models.Api
{
existingGroup.Name = Name;
existingGroup.AccessAll = AccessAll.Value;
existingGroup.ExternalId = ExternalId;
return existingGroup;
}
}

View File

@ -20,12 +20,14 @@ namespace Bit.Core.Models.Api
OrganizationId = group.OrganizationId.ToString();
Name = group.Name;
AccessAll = group.AccessAll;
ExternalId = group.ExternalId;
}
public string Id { get; set; }
public string OrganizationId { get; set; }
public string Name { get; set; }
public bool AccessAll { get; set; }
public string ExternalId { get; set; }
}
public class GroupDetailsResponseModel : GroupResponseModel

View File

@ -9,6 +9,7 @@ namespace Bit.Core.Models.Table
public Guid OrganizationId { get; set; }
public string Name { get; set; }
public bool AccessAll { get; set; }
public string ExternalId { get; set; }
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;

View File

@ -3,6 +3,7 @@
@OrganizationId UNIQUEIDENTIFIER,
@Name VARCHAR(MAX),
@AccessAll BIT,
@ExternalId NVARCHAR(50),
@CreationDate DATETIME2(7),
@RevisionDate DATETIME2(7)
AS
@ -15,6 +16,7 @@ BEGIN
[OrganizationId],
[Name],
[AccessAll],
[ExternalId],
[CreationDate],
[RevisionDate]
)
@ -24,6 +26,7 @@ BEGIN
@OrganizationId,
@Name,
@AccessAll,
@ExternalId,
@CreationDate,
@RevisionDate
)

View File

@ -3,6 +3,7 @@
@OrganizationId UNIQUEIDENTIFIER,
@Name VARCHAR(MAX),
@AccessAll BIT,
@ExternalId NVARCHAR(50),
@CreationDate DATETIME2(7),
@RevisionDate DATETIME2(7),
@Collections AS [dbo].[SelectionReadOnlyArray] READONLY
@ -10,7 +11,7 @@ AS
BEGIN
SET NOCOUNT ON
EXEC [dbo].[Group_Create] @Id, @OrganizationId, @Name, @AccessAll, @CreationDate, @RevisionDate
EXEC [dbo].[Group_Create] @Id, @OrganizationId, @Name, @AccessAll, @ExternalId, @CreationDate, @RevisionDate
;WITH [AvailableCollectionsCTE] AS(
SELECT

View File

@ -3,6 +3,7 @@
@OrganizationId UNIQUEIDENTIFIER,
@Name VARCHAR(MAX),
@AccessAll BIT,
@ExternalId NVARCHAR(50),
@CreationDate DATETIME2(7),
@RevisionDate DATETIME2(7)
AS
@ -15,6 +16,7 @@ BEGIN
[OrganizationId] = @OrganizationId,
[Name] = @Name,
[AccessAll] = @AccessAll,
[ExternalId] = @ExternalId,
[CreationDate] = @CreationDate,
[RevisionDate] = @RevisionDate
WHERE

View File

@ -3,6 +3,7 @@
@OrganizationId UNIQUEIDENTIFIER,
@Name VARCHAR(MAX),
@AccessAll BIT,
@ExternalId NVARCHAR(50),
@CreationDate DATETIME2(7),
@RevisionDate DATETIME2(7),
@Collections AS [dbo].[SelectionReadOnlyArray] READONLY
@ -10,7 +11,7 @@ AS
BEGIN
SET NOCOUNT ON
EXEC [dbo].[Group_Update] @Id, @OrganizationId, @Name, @AccessAll, @CreationDate, @RevisionDate
EXEC [dbo].[Group_Update] @Id, @OrganizationId, @Name, @AccessAll, @ExternalId, @CreationDate, @RevisionDate
;WITH [AvailableCollectionsCTE] AS(
SELECT

View File

@ -3,6 +3,7 @@
[OrganizationId] UNIQUEIDENTIFIER NOT NULL,
[Name] NVARCHAR (50) NOT NULL,
[AccessAll] BIT NOT NULL,
[ExternalId] NVARCHAR (50) NULL,
[CreationDate] DATETIME NOT NULL,
[RevisionDate] DATETIME NOT NULL,
CONSTRAINT [PK_Group] PRIMARY KEY CLUSTERED ([Id] ASC),