1
0
mirror of https://github.com/bitwarden/server synced 2026-01-05 01:53:17 +00:00

added max subvault count. check max org users.

This commit is contained in:
Kyle Spearrin
2017-04-07 16:41:04 -04:00
parent e3cc1b9411
commit 51e8d3f1a7
12 changed files with 78 additions and 3 deletions

View File

@@ -21,6 +21,19 @@ namespace Bit.Core.Repositories.SqlServer
: base(connectionString)
{ }
public async Task<int> GetCountByOrganizationIdAsync(Guid organizationId)
{
using(var connection = new SqlConnection(ConnectionString))
{
var results = await connection.ExecuteScalarAsync<int>(
"[dbo].[OrganizationUser_ReadCountByOrganizationId]",
new { OrganizationId = organizationId },
commandType: CommandType.StoredProcedure);
return results;
}
}
public async Task<int> GetCountByFreeOrganizationAdminUserAsync(Guid userId)
{
using(var connection = new SqlConnection(ConnectionString))

View File

@@ -19,6 +19,19 @@ namespace Bit.Core.Repositories.SqlServer
: base(connectionString)
{ }
public async Task<int> GetCountByOrganizationIdAsync(Guid organizationId)
{
using(var connection = new SqlConnection(ConnectionString))
{
var results = await connection.ExecuteScalarAsync<int>(
"[dbo].[Subvault_ReadCountByOrganizationId]",
new { OrganizationId = organizationId },
commandType: CommandType.StoredProcedure);
return results;
}
}
public async Task<ICollection<Subvault>> GetManyByOrganizationIdAsync(Guid organizationId)
{
using(var connection = new SqlConnection(ConnectionString))