Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Added support for opening shortcut files as another user #13131

Merged
merged 1 commit into from
Aug 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Files.App/Actions/Content/Run/RunAsAdminAction.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.App.Utils.Shell;

namespace Files.App.Actions
{
internal class RunAsAdminAction : ObservableObject, IAction
Expand All @@ -20,7 +18,9 @@ public RichGlyph Glyph

public bool IsExecutable =>
context.SelectedItem is not null &&
FileExtensionHelpers.IsExecutableFile(context.SelectedItem.FileExtension);
(FileExtensionHelpers.IsExecutableFile(context.SelectedItem.FileExtension) ||
(context.SelectedItem is ShortcutItem shortcut &&
shortcut.IsExecutable));

public RunAsAdminAction()
{
Expand Down
6 changes: 3 additions & 3 deletions src/Files.App/Actions/Content/Run/RunAsAnotherUserAction.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.App.Utils.Shell;

namespace Files.App.Actions
{
internal class RunAsAnotherUserAction : ObservableObject, IAction
Expand All @@ -11,7 +9,9 @@ internal class RunAsAnotherUserAction : ObservableObject, IAction

public bool IsExecutable =>
context.SelectedItem is not null &&
FileExtensionHelpers.IsExecutableFile(context.SelectedItem.FileExtension);
(FileExtensionHelpers.IsExecutableFile(context.SelectedItem.FileExtension) ||
(context.SelectedItem is ShortcutItem shortcut &&
shortcut.IsExecutable));

public string Label
=> "BaseLayoutContextFlyoutRunAsAnotherUser/Text".GetLocalizedResource();
Expand Down