Users: Hiding the Unpublish and Delete buttons in the User editor

This commit is contained in:
Benedek Farkas
2025-09-26 18:41:31 +02:00
parent e7e888d422
commit 99ce4ca61e
5 changed files with 8 additions and 2 deletions
@@ -5,7 +5,7 @@ using Orchard.Users.Models;
namespace Orchard.Users.Drivers { namespace Orchard.Users.Drivers {
/// <summary> /// <summary>
/// This class intentionnaly has no Display method to prevent external access to this information through standard /// This class intentionally has no Display method to prevent external access to this information through standard
/// Content Item display methods. /// Content Item display methods.
/// </summary> /// </summary>
public class UserPartDriver : ContentPartDriver<UserPart> { public class UserPartDriver : ContentPartDriver<UserPart> {
@@ -252,6 +252,8 @@
<Content Include="Views\EditorTemplates\Parts\Users.SuspensionSettings.cshtml" /> <Content Include="Views\EditorTemplates\Parts\Users.SuspensionSettings.cshtml" />
<Content Include="Views\EditorTemplates\Parts\User.UserSecurityConfiguration.cshtml" /> <Content Include="Views\EditorTemplates\Parts\User.UserSecurityConfiguration.cshtml" />
<Content Include="Views\Account\RequestChallengeEmail.cshtml" /> <Content Include="Views\Account\RequestChallengeEmail.cshtml" />
<Content Include="Views\Content.UnpublishButton-User.cshtml" />
<Content Include="Views\Content.DeleteButton-User.cshtml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Views\Account\ChangeExpiredPassword.cshtml" /> <Content Include="Views\Account\ChangeExpiredPassword.cshtml" />
@@ -3,5 +3,7 @@
<Place Parts_User_EditPassword_Edit="Content:1"/> <Place Parts_User_EditPassword_Edit="Content:1"/>
<Place Parts_User_UserSecurityConfiguration_Edit="Content:1.1"/> <Place Parts_User_UserSecurityConfiguration_Edit="Content:1.1"/>
<Place Parts_UserApprove_Edit="Sidebar:25"/> <!-- immediately following the contents module's Approve Now button --> <Place Parts_UserApprove_Edit="Sidebar:25"/> <!-- immediately following the contents module's Approve Now button -->
<!-- The Unpublish and Delete buttons are hidden with type-specific shape overrides, because placement wasn't effective. -->
</Match> </Match>
</Placement> </Placement>