mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-13 17:23:02 -05:00
Prepopulate server roles in Login dialog (#2011)
This commit is contained in:
@@ -101,8 +101,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Security
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO move this to LoginData
|
// TODO move this to LoginData
|
||||||
// TODO support role assignment for Azure
|
// TODO support role assignment for Azure
|
||||||
prototype.ServerRoles.PopulateServerRoles();
|
|
||||||
foreach (string role in login.ServerRoles ?? Enumerable.Empty<string>())
|
foreach (string role in login.ServerRoles ?? Enumerable.Empty<string>())
|
||||||
{
|
{
|
||||||
prototype.ServerRoles.SetMember(role, true);
|
prototype.ServerRoles.SetMember(role, true);
|
||||||
|
|||||||
@@ -1514,6 +1514,7 @@ INNER JOIN sys.sql_logins AS sql_logins
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.serverRoles = new ServerRoles(server, login.Name);
|
this.serverRoles = new ServerRoles(server, login.Name);
|
||||||
|
this.serverRoles.PopulateServerRoles();
|
||||||
this.databaseRolesCollection = new HybridDictionary();
|
this.databaseRolesCollection = new HybridDictionary();
|
||||||
if (server.Information.Version.Major == 9 && !string.IsNullOrEmpty(login.Credential))
|
if (server.Information.Version.Major == 9 && !string.IsNullOrEmpty(login.Credential))
|
||||||
{
|
{
|
||||||
@@ -1539,6 +1540,7 @@ INNER JOIN sys.sql_logins AS sql_logins
|
|||||||
this.defaultLanguage = LoginPrototypeData.DefaultLanguageDisplay;
|
this.defaultLanguage = LoginPrototypeData.DefaultLanguageDisplay;
|
||||||
|
|
||||||
this.serverRoles = new ServerRoles(server);
|
this.serverRoles = new ServerRoles(server);
|
||||||
|
this.serverRoles.PopulateServerRoles();
|
||||||
this.databaseRolesCollection = new HybridDictionary();
|
this.databaseRolesCollection = new HybridDictionary();
|
||||||
this.credentials = new StringCollection();
|
this.credentials = new StringCollection();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user