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

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