mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-06 01:25:43 -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:
@@ -51,16 +51,12 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Security
|
||||
{
|
||||
return new UserInfo()
|
||||
{
|
||||
Type = DatabaseUserType.UserWithLogin,
|
||||
UserName = "TestUserName_" + new Random().NextInt64(10000000,90000000).ToString(),
|
||||
Type = DatabaseUserType.WithLogin,
|
||||
Name = "TestUserName_" + new Random().NextInt64(10000000,90000000).ToString(),
|
||||
LoginName = loginName,
|
||||
Password = "placeholder",
|
||||
DefaultSchema = "dbo",
|
||||
OwnedSchemas = new string[] { "dbo" },
|
||||
isEnabled = false,
|
||||
isAAD = false,
|
||||
ExtendedProperties = null,
|
||||
SecurablePermissions = null
|
||||
OwnedSchemas = new string[] { "dbo" }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Security
|
||||
|
||||
var userParams = new CreateUserParams
|
||||
{
|
||||
OwnerUri = connectionResult.ConnectionInfo.OwnerUri,
|
||||
ContextId = connectionResult.ConnectionInfo.OwnerUri,
|
||||
User = SecurityTestUtils.GetTestUserInfo(loginParams.Login.LoginName)
|
||||
};
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Security
|
||||
|
||||
// verify the result
|
||||
createUserContext.Verify(x => x.SendResult(It.Is<CreateUserResult>
|
||||
(p => p.Success && p.User.UserName != string.Empty)));
|
||||
(p => p.Success && p.User.Name != string.Empty)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user