Fix additional contained user/sqldb bugs (#1983)

This commit is contained in:
Karl Burtram
2023-04-03 19:26:53 -07:00
committed by GitHub
parent d9f473e604
commit 0b2eb26d45
2 changed files with 5 additions and 4 deletions

View File

@@ -132,8 +132,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Security
}
// Default language is only applicable for users inside a contained database.
if (parentDb.ContainmentType != ContainmentType.None
&& LanguageUtils.IsDefaultLanguageSupported(dataContainer.Server))
if (LanguageUtils.IsDefaultLanguageSupported(dataContainer.Server)
&& parentDb.ContainmentType != ContainmentType.None)
{
defaultLanguageAlias = LanguageUtils.GetLanguageAliasFromName(
existingUser.Parent.Parent,

View File

@@ -870,8 +870,9 @@ namespace Microsoft.SqlTools.ServiceLayer.Security
{
get
{
//Default Language was not supported before Denali.
return SqlMgmtUtils.IsSql11OrLater(this.context.Server.ConnectionContext.ServerVersion);
//Default Language was not supported before Denali or on SQL DB.
bool isSqlAzure = this.context.ServerConnection.DatabaseEngineType == DatabaseEngineType.SqlAzureDatabase;
return !isSqlAzure && SqlMgmtUtils.IsSql11OrLater(this.context.Server.ConnectionContext.ServerVersion);
}
}