UX: display 'merge' button in all non-staff user profiles.

UX: display ‘merge’ button in all non-staff user profiles.

diff --git a/app/assets/javascripts/admin/templates/user-index.hbs b/app/assets/javascripts/admin/templates/user-index.hbs
index 76aee47..adbe7e5 100644
--- a/app/assets/javascripts/admin/templates/user-index.hbs
+++ b/app/assets/javascripts/admin/templates/user-index.hbs
@@ -683,6 +683,9 @@
                  icon="trash-alt"
                  class="btn-danger"
                  action=(action "destroy")}}
+    {{/if}}
+
+    {{#if model.can_be_merged}}
       {{d-button label="admin.user.merge.transfer_and_delete"
                  icon="trash-alt"
                  class="btn-danger"
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb
index 4ed8a10..8902781 100644
--- a/app/controllers/admin/users_controller.rb
+++ b/app/controllers/admin/users_controller.rb
@@ -476,7 +476,7 @@ class Admin::UsersController < Admin::AdminController
     target_username = params.require(:target_username)
     target_user = User.find_by_username(target_username)
 
-    guardian.ensure_can_merge_user!(@user, target_user)
+    guardian.ensure_can_merge_users!(@user, target_user)
 
     if user = UserMerger.new(@user, target_user, current_user).merge!
       render json: success_json.merge(merged: true, user: user)
diff --git a/app/serializers/admin_detailed_user_serializer.rb b/app/serializers/admin_detailed_user_serializer.rb
index 4a83a59..c0b18e3 100644
--- a/app/serializers/admin_detailed_user_serializer.rb
+++ b/app/serializers/admin_detailed_user_serializer.rb
@@ -18,6 +18,7 @@ class AdminDetailedUserSerializer < AdminUserSerializer
              :can_delete_all_posts,
              :can_be_deleted,
              :can_be_anonymized,
+             :can_be_merged,
              :full_suspend_reason,
              :suspended_till,
              :silence_reason,
@@ -74,6 +75,10 @@ class AdminDetailedUserSerializer < AdminUserSerializer
     scope.can_anonymize_user?(object)
   end
 
+  def can_be_merged
+    scope.can_merge_user?(object)
+  end
+
   def topic_count
     object.topics.count
   end
diff --git a/lib/guardian/user_guardian.rb b/lib/guardian/user_guardian.rb
index 1461c69..d8b65e1 100644
--- a/lib/guardian/user_guardian.rb
+++ b/lib/guardian/user_guardian.rb
@@ -76,8 +76,12 @@ module UserGuardian
     is_staff? && !user.nil? && !user.staff?
   end
 
-  def can_merge_user?(source_user, target_user)
-    is_admin? && !source_user.nil? && !source_user.staff? && !target_user.nil?
+  def can_merge_user?(user)
+    is_admin? && !user.nil? && !user.staff?
+  end
+
+  def can_merge_users?(source_user, target_user)
+    can_merge_user?(source_user) && !target_user.nil?
   end
 
   def can_reset_bounce_score?(user)

GitHub sha: e5c44f6d