mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-06 09:35:39 -05:00
User creation handler clean-ups (#1867)
* Wire up init user message * Send schema list * Load database roles * Add create user * Add a delete user handler and format service file
This commit is contained in:
@@ -8,15 +8,43 @@ using Microsoft.SqlTools.ServiceLayer.Utility;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Security.Contracts
|
||||
{
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialize User View parameters
|
||||
/// </summary>
|
||||
public class InitializeUserViewParams
|
||||
{
|
||||
public string? ContextId { get; set; }
|
||||
|
||||
public string? ConnectionUri { get; set; }
|
||||
|
||||
public bool isNewObject { get; set; }
|
||||
|
||||
public string? Database { get; set; }
|
||||
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize User View request type
|
||||
/// </summary>
|
||||
public class InitializeUserViewRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Request definition
|
||||
/// </summary>
|
||||
public static readonly
|
||||
RequestType<InitializeUserViewParams, UserViewInfo> Type =
|
||||
RequestType<InitializeUserViewParams, UserViewInfo>.Create("objectManagement/initializeUserView");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create User parameters
|
||||
/// </summary>
|
||||
public class CreateUserParams : GeneralRequestDetails
|
||||
{
|
||||
public string OwnerUri { get; set; }
|
||||
|
||||
public UserInfo User { get; set; }
|
||||
public string? ContextId { get; set; }
|
||||
public UserInfo? User { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -24,10 +52,9 @@ namespace Microsoft.SqlTools.ServiceLayer.Security.Contracts
|
||||
/// </summary>
|
||||
public class CreateUserResult : ResultStatus
|
||||
{
|
||||
public UserInfo User { get; set; }
|
||||
public UserInfo? User { get; set; }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create User request type
|
||||
/// </summary>
|
||||
@@ -38,17 +65,19 @@ namespace Microsoft.SqlTools.ServiceLayer.Security.Contracts
|
||||
/// </summary>
|
||||
public static readonly
|
||||
RequestType<CreateUserParams, CreateUserResult> Type =
|
||||
RequestType<CreateUserParams, CreateUserResult>.Create("objectmanagement/createuser");
|
||||
RequestType<CreateUserParams, CreateUserResult>.Create("objectManagement/createUser");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete User params
|
||||
/// </summary>
|
||||
public class DeleteUserParams : GeneralRequestDetails
|
||||
public class DeleteUserParams
|
||||
{
|
||||
public string OwnerUri { get; set; }
|
||||
|
||||
public string UserName { get; set; }
|
||||
public string? ConnectionUri { get; set; }
|
||||
|
||||
public string? Database { get; set; }
|
||||
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -61,6 +90,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Security.Contracts
|
||||
/// </summary>
|
||||
public static readonly
|
||||
RequestType<DeleteUserParams, ResultStatus> Type =
|
||||
RequestType<DeleteUserParams, ResultStatus>.Create("objectmanagement/deleteuser");
|
||||
RequestType<DeleteUserParams, ResultStatus>.Create("objectManagement/deleteUser");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user