From 2c730e1ca27bb7a6882cc6d7ee56e09bb1e24013 Mon Sep 17 00:00:00 2001 From: Martin Meyerhoff Date: Fri, 22 Jul 2022 11:22:20 +0200 Subject: [PATCH] Allow Site managers to remove page locks One of my client has page locks that are years old, due to users that are not in the organization any longer and that never properly locked out. This change allows admin users to remove stale page locks. --- .../admin/dashboard/_locked_pages.html.erb | 2 +- spec/features/admin/dashboard_spec.rb | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/views/alchemy/admin/dashboard/_locked_pages.html.erb b/app/views/alchemy/admin/dashboard/_locked_pages.html.erb index 8e1d0c4a01..b65cd3f2b3 100644 --- a/app/views/alchemy/admin/dashboard/_locked_pages.html.erb +++ b/app/views/alchemy/admin/dashboard/_locked_pages.html.erb @@ -36,7 +36,7 @@ <% end %> - <% if current_alchemy_user.id == page.locked_by %> + <% if (current_alchemy_user.id == page.locked_by) || can?(:manage, Alchemy::Site.current) %> <%= form_tag(alchemy.unlock_admin_page_path(page, :redirect_to => alchemy.admin_dashboard_url)) do %>