Skip to content

Commit

Permalink
Hide permissions if a login doesn't support it (#24888) (#24902)
Browse files Browse the repository at this point in the history
* Hide permissions if a login doesn't support it (#24888)

* Bump STS version
  • Loading branch information
corivera committed Nov 7, 2023
1 parent 7d37e4c commit c7c2b2f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion extensions/mssql/config.json
@@ -1,6 +1,6 @@
{
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
"version": "4.10.1.2",
"version": "4.10.1.3",
"downloadFileNames": {
"Windows_86": "win-x86-net7.0.zip",
"Windows_64": "win-x64-net7.0.zip",
Expand Down
5 changes: 4 additions & 1 deletion extensions/mssql/src/objectManagement/ui/loginDialog.ts
Expand Up @@ -13,6 +13,7 @@ import { isValidSQLPassword } from '../utils';
import { DefaultMaxTableRowCount } from '../../ui/dialogBase';
import { PrincipalDialogBase } from './principalDialogBase';
import { AuthenticationType, Login, LoginViewInfo } from '../interfaces';
import { isUndefinedOrNull } from '../../types';

export class LoginDialog extends PrincipalDialogBase<Login, LoginViewInfo> {
private generalSection: azdata.GroupContainer;
Expand Down Expand Up @@ -96,7 +97,9 @@ export class LoginDialog extends PrincipalDialogBase<Login, LoginViewInfo> {

this.initializeServerRolesSection();
sections.push(this.serverRoleSection);
sections.push(this.securableSection);
if (this.options.isNewObject || !isUndefinedOrNull(this.objectInfo.securablePermissions)) {
sections.push(this.securableSection);
}

this.formContainer.addItems(sections, this.getSectionItemLayout());
}
Expand Down
Expand Up @@ -40,7 +40,7 @@ export abstract class PrincipalDialogBase<ObjectInfoType extends SecurityPrincip
}

protected override async initializeUI(): Promise<void> {
this.securablePermissions = deepClone(this.objectInfo.securablePermissions);
this.securablePermissions = deepClone(this.objectInfo.securablePermissions) ?? [];
this.initializeSecurableSection();
}

Expand Down

0 comments on commit c7c2b2f

Please sign in to comment.