mirror of
https://github.com/microsoft/vscode.git
synced 2026-10-06 05:07:29 +01:00
remove workspace trust grant/deny actions from gear
This commit is contained in:
1 parent
e143ce4a8c
commit
084668c627
1 file changed
-79
@@ -288,85 +288,6 @@ Registry.as<IEditorRegistry>(EditorExtensions.Editors).registerEditor(
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// Grant Workspace Trust
|
||||
registerAction2(class extends Action2 {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'workbench.trust.grant',
|
||||
title: {
|
||||
original: 'Grant Workspace Trust',
|
||||
value: localize('grantWorkspaceTrust', "Grant Workspace Trust")
|
||||
},
|
||||
category: localize('workspacesCategory', "Workspaces"),
|
||||
f1: true,
|
||||
precondition: WorkspaceTrustContext.IsTrusted.negate(),
|
||||
menu: {
|
||||
id: MenuId.GlobalActivity,
|
||||
when: WorkspaceTrustContext.PendingRequest,
|
||||
group: '6_workspace_trust',
|
||||
order: 10
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async run(accessor: ServicesAccessor) {
|
||||
const dialogService = accessor.get(IDialogService);
|
||||
const workspaceTrustRequestService = accessor.get(IWorkspaceTrustRequestService);
|
||||
|
||||
const result = await dialogService.confirm({
|
||||
message: localize('grantWorkspaceTrust', "Grant Workspace Trust"),
|
||||
detail: localize('confirmGrantWorkspaceTrust', "Granting trust to the workspace will enable features that may pose a security risk if the contents of the workspace cannot be trusted. Are you sure you want to trust this workspace?"),
|
||||
primaryButton: localize('yes', 'Yes'),
|
||||
secondaryButton: localize('no', 'No')
|
||||
});
|
||||
|
||||
if (result.confirmed) {
|
||||
workspaceTrustRequestService.completeRequest(true);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
// Deny Workspace Trust
|
||||
registerAction2(class extends Action2 {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'workbench.trust.deny',
|
||||
title: {
|
||||
original: 'Deny Workspace Trust',
|
||||
value: localize('denyWorkspaceTrust', "Deny Workspace Trust")
|
||||
},
|
||||
category: localize('workspacesCategory', "Workspaces"),
|
||||
f1: true,
|
||||
precondition: WorkspaceTrustContext.IsTrusted,
|
||||
menu: {
|
||||
id: MenuId.GlobalActivity,
|
||||
when: WorkspaceTrustContext.IsTrusted,
|
||||
group: '6_workspace_trust',
|
||||
order: 20
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async run(accessor: ServicesAccessor) {
|
||||
const dialogService = accessor.get(IDialogService);
|
||||
const workspaceTrustRequestService = accessor.get(IWorkspaceTrustRequestService);
|
||||
|
||||
const result = await dialogService.confirm({
|
||||
message: localize('denyWorkspaceTrust', "Deny Workspace Trust"),
|
||||
detail: localize('confirmDenyWorkspaceTrust', "Denying trust to the workspace will disable features that may pose a security risk if the contents of the workspace cannot be trusted. Are you sure you want to deny trust to this workspace?"),
|
||||
primaryButton: localize('yes', 'Yes'),
|
||||
secondaryButton: localize('no', 'No')
|
||||
});
|
||||
|
||||
if (result.confirmed) {
|
||||
workspaceTrustRequestService.completeRequest(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
// Manage Workspace Trust
|
||||
registerAction2(class extends Action2 {
|
||||
constructor() {
|
||||
|
||||
Reference in new issue
Block a user