diff --git a/app/serializers/admin_user_serializer.rb b/app/serializers/admin_user_serializer.rb index 0fa30b658e6..df7f279f619 100644 --- a/app/serializers/admin_user_serializer.rb +++ b/app/serializers/admin_user_serializer.rb @@ -8,8 +8,7 @@ class AdminUserSerializer < AdminUserListSerializer :can_activate, :can_deactivate, :ip_address, - :registration_ip_address, - :can_send_activation_email + :registration_ip_address has_one :single_sign_on_record, serializer: SingleSignOnRecordSerializer, embed: :objects diff --git a/lib/guardian.rb b/lib/guardian.rb index 91c4bebbc01..7085ce17f4d 100644 --- a/lib/guardian.rb +++ b/lib/guardian.rb @@ -126,9 +126,12 @@ class Guardian end alias :can_move_posts? :can_moderate? alias :can_see_flags? :can_moderate? - alias :can_send_activation_email? :can_moderate? alias :can_close? :can_moderate? + def can_send_activation_email?(user) + user && is_staff? && !SiteSetting.must_approve_users? + end + def can_grant_badges?(_user) SiteSetting.enable_badges && is_staff? end