diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs index 613fa1e7..d066c9bc 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs @@ -9717,6 +9717,14 @@ namespace Microsoft.SqlTools.ServiceLayer } } + public static string ResetPasswordWhileUnlocking + { + get + { + return Keys.GetString(Keys.ResetPasswordWhileUnlocking); + } + } + public static string ConnectionServiceListDbErrorNotConnected(string uri) { return Keys.GetString(Keys.ConnectionServiceListDbErrorNotConnected, uri); @@ -14038,6 +14046,9 @@ namespace Microsoft.SqlTools.ServiceLayer public const string DefaultLanguagePlaceholder = "DefaultLanguagePlaceholder"; + public const string ResetPasswordWhileUnlocking = "ResetPasswordWhileUnlocking"; + + private Keys() { } diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx index c557cc89..1f0441f6 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx @@ -5390,4 +5390,8 @@ The Query Processor estimates that implementing the following index could improv <default> + + Reset password for the login while unlocking. + + diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings index 00d5df71..d5167f94 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings @@ -2447,4 +2447,4 @@ ErrorConnectionNotFound = The connection could not be found ############################################################################ # Security Service DefaultLanguagePlaceholder = - +ResetPasswordWhileUnlocking = Reset password for the login while unlocking. diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf index 06175fa7..c29b7598 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf @@ -6571,6 +6571,11 @@ The Query Processor estimates that implementing the following index could improv <default> + + Reset password for the login while unlocking. + Reset password for the login while unlocking. + + \ No newline at end of file diff --git a/src/Microsoft.SqlTools.ServiceLayer/Security/LoginData.cs b/src/Microsoft.SqlTools.ServiceLayer/Security/LoginData.cs index 5e5d365d..c7f68b4c 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Security/LoginData.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Security/LoginData.cs @@ -1422,6 +1422,7 @@ INNER JOIN sys.sql_logins AS sql_logins result.isDisabled = this.isDisabled; result.enforcePolicy = this.enforcePolicy; result.enforceExpiration = this.enforceExpiration; + result.isLockedOut = this.isLockedOut; result.certificateName = this.certificateName; result.asymmetricKeyName = this.asymmetricKeyName; @@ -2321,7 +2322,7 @@ INNER JOIN sys.sql_logins AS sql_logins && (this.currentState.IsLockedOut != this.originalState.IsLockedOut) ) { - throw new ArgumentException("CreateLoginSR.ResetPasswordWhileUnlocking"); + throw new Exception(SR.ResetPasswordWhileUnlocking); } } } diff --git a/src/Microsoft.SqlTools.ServiceLayer/Security/SecurityService.cs b/src/Microsoft.SqlTools.ServiceLayer/Security/SecurityService.cs index 493ca1a8..2f2d7ce6 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Security/SecurityService.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Security/SecurityService.cs @@ -317,7 +317,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Security SupportWindowsAuthentication = prototype.WindowsAuthSupported, SupportAADAuthentication = prototype.AADAuthSupported, SupportSQLAuthentication = true, // SQL Auth support for login, not necessarily mean SQL Auth support for CONNECT etc. - CanEditLockedOutState = true, + CanEditLockedOutState = !parameters.IsNewObject && prototype.IsLockedOut, Databases = databases, Languages = languages, ServerRoles = prototype.ServerRoles.ServerRoleNames,