mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-13 17:23:02 -05:00
Fix 'Contained DB' property check exception on SQL DB (#1979)
This commit is contained in:
@@ -152,9 +152,13 @@ namespace Microsoft.SqlTools.ServiceLayer.Security
|
||||
defaultSchema = defaultSchemaPrototype.DefaultSchema;
|
||||
}
|
||||
|
||||
ServerConnection serverConnection = dataContainer.ServerConnection;
|
||||
bool isSqlAzure = serverConnection.DatabaseEngineType == DatabaseEngineType.SqlAzureDatabase;
|
||||
bool supportsContainedUser = isSqlAzure || UserActions.IsParentDatabaseContained(parentDb);
|
||||
|
||||
// set default alias to <default> if needed
|
||||
if (string.IsNullOrEmpty(defaultLanguageAlias)
|
||||
&& parentDb.ContainmentType != ContainmentType.None
|
||||
&& supportsContainedUser
|
||||
&& LanguageUtils.IsDefaultLanguageSupported(dataContainer.Server))
|
||||
{
|
||||
defaultLanguageAlias = SR.DefaultLanguagePlaceholder;
|
||||
@@ -197,8 +201,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Security
|
||||
schemaNames.Add(schema);
|
||||
}
|
||||
}
|
||||
|
||||
ServerConnection serverConnection = dataContainer.ServerConnection;
|
||||
|
||||
UserViewInfo userViewInfo = new UserViewInfo()
|
||||
{
|
||||
ObjectInfo = new UserInfo()
|
||||
@@ -214,7 +217,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Security
|
||||
DefaultLanguage = SecurityService.FormatLanguageDisplay(
|
||||
languageOptions.FirstOrDefault(o => o?.Language.Name == defaultLanguageAlias || o?.Language.Alias == defaultLanguageAlias, null)),
|
||||
},
|
||||
SupportContainedUser = UserActions.IsParentDatabaseContained(parentDb), // support for these will be added later
|
||||
SupportContainedUser = supportsContainedUser,
|
||||
SupportWindowsAuthentication = false,
|
||||
SupportAADAuthentication = false,
|
||||
SupportSQLAuthentication = true,
|
||||
|
||||
Reference in New Issue
Block a user