diff --git a/app/policies/account_policy.rb b/app/policies/account_policy.rb index 7e95367f..d17a513d 100644 --- a/app/policies/account_policy.rb +++ b/app/policies/account_policy.rb @@ -14,7 +14,7 @@ class AccountPolicy < ApplicationPolicy end def suspend? - staff? && !record.user&.staff? + staff? && !record.user&.staff? && !record.is_pro? && !record.is_investor? && !record.is_donor? && !record.is_verified? end def unsuspend? diff --git a/app/services/suspend_account_service.rb b/app/services/suspend_account_service.rb index 3b5c1031..d2e78387 100644 --- a/app/services/suspend_account_service.rb +++ b/app/services/suspend_account_service.rb @@ -45,6 +45,7 @@ class SuspendAccountService < BaseService # @option [Boolean] :destroy Remove the account record instead of suspending def call(account, **options) @account = account + return true if @account.is_pro? || @account.is_verified? || @account.is_donor? || @account.is_investor? @options = options purge_user! diff --git a/app/views/admin/reports/show.html.haml b/app/views/admin/reports/show.html.haml index 863dada9..a512f970 100644 --- a/app/views/admin/reports/show.html.haml +++ b/app/views/admin/reports/show.html.haml @@ -11,7 +11,8 @@ = link_to t('admin.accounts.warn'), new_admin_account_action_path(@report.target_account_id, type: 'none', report_id: @report.id), class: 'button' = link_to t('admin.accounts.disable'), new_admin_account_action_path(@report.target_account_id, type: 'disable', report_id: @report.id), class: 'button button--destructive' = link_to t('admin.accounts.silence'), new_admin_account_action_path(@report.target_account_id, type: 'silence', report_id: @report.id), class: 'button button--destructive' - = link_to t('admin.accounts.perform_full_suspension'), new_admin_account_action_path(@report.target_account_id, type: 'suspend', report_id: @report.id), class: 'button button--destructive' + - if !@report.target_account.is_pro? && !@report.target_account.is_investor? && !@report.target_account.is_donor? && !@report.target_account.is_verified? + = link_to t('admin.accounts.perform_full_suspension'), new_admin_account_action_path(@report.target_account_id, type: 'suspend', report_id: @report.id), class: 'button button--destructive' %div{ style: 'float: left' } = link_to t('admin.reports.mark_as_resolved'), resolve_admin_report_path(@report), method: :post, class: 'button' - else