Fix lock out for login update (#1923)

* Fix CanEditLockedOutState

* fix CanEditLockedOutState

* fix locked out
This commit is contained in:
Hai Cao
2023-03-08 18:17:23 -08:00
committed by GitHub
parent b424d45902
commit 17c9a99d24
6 changed files with 24 additions and 3 deletions

View File

@@ -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()
{ }

View File

@@ -5390,4 +5390,8 @@ The Query Processor estimates that implementing the following index could improv
<value>&lt;default&gt;</value>
<comment></comment>
</data>
<data name="ResetPasswordWhileUnlocking" xml:space="preserve">
<value>Reset password for the login while unlocking.</value>
<comment></comment>
</data>
</root>

View File

@@ -2447,4 +2447,4 @@ ErrorConnectionNotFound = The connection could not be found
############################################################################
# Security Service
DefaultLanguagePlaceholder = <default>
ResetPasswordWhileUnlocking = Reset password for the login while unlocking.

View File

@@ -6571,6 +6571,11 @@ The Query Processor estimates that implementing the following index could improv
<target state="new">&lt;default&gt;</target>
<note></note>
</trans-unit>
<trans-unit id="ResetPasswordWhileUnlocking">
<source>Reset password for the login while unlocking.</source>
<target state="new">Reset password for the login while unlocking.</target>
<note></note>
</trans-unit>
</body>
</file>
</xliff>

View File

@@ -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);
}
}
}

View File

@@ -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,