Merge duplicate Spree::User#superadmin? into existing Spree::admin?

This commit is contained in:
Luis Ramos
2020-08-19 09:53:08 +01:00
parent ebf4175662
commit f28241cc5e
3 changed files with 7 additions and 30 deletions

View File

@@ -53,11 +53,11 @@ module Spree
spree_roles.where(name: role_in_question.to_s).any?
end
# Checks whether the specified user is a superadmin, with full control of the instance
def admin?
has_spree_role?('admin')
end
# handle_asynchronously will define send_reset_password_instructions_with_delay.
# If handle_asynchronously is called twice, we get an infinite job loop.
handle_asynchronously :send_reset_password_instructions unless method_defined? :send_reset_password_instructions_with_delay
@@ -120,14 +120,6 @@ module Spree
end
end
# Checks whether the specified user is a superadmin, with full control of the
# instance
#
# @return [Boolean]
def superadmin?
has_spree_role?('admin')
end
def generate_spree_api_key!
self.spree_api_key = SecureRandom.hex(24)
save!