Commit 4397631c authored by Robert Speicher's avatar Robert Speicher

Merge branch 'winh-remove-prepend_entity' into 'master'

Remove prepend_entity from EE::API::Entities

See merge request gitlab-org/gitlab-ee!15683
parents 1fa80e89 ee0cd772
...@@ -3,24 +3,6 @@ ...@@ -3,24 +3,6 @@
module EE module EE
module API module API
module Entities module Entities
#######################
# Entities extensions #
#######################
module Entities
extend ActiveSupport::Concern
class_methods do
def prepend_entity(klass, with: nil)
if with.nil?
raise ArgumentError, 'You need to pass either the :with or :namespace option!'
end
klass.descendants.each { |descendant| descendant.prepend(with) }
klass.prepend(with)
end
end
end
module EntityHelpers module EntityHelpers
def can_read(attr, &block) def can_read(attr, &block)
->(obj, opts) { Ability.allowed?(opts[:user], "read_#{attr}".to_sym, yield(obj)) } ->(obj, opts) { Ability.allowed?(opts[:user], "read_#{attr}".to_sym, yield(obj)) }
......
...@@ -1727,7 +1727,6 @@ module API ...@@ -1727,7 +1727,6 @@ module API
end end
# rubocop: disable Cop/InjectEnterpriseEditionModule # rubocop: disable Cop/InjectEnterpriseEditionModule
API::Entities.prepend_if_ee('EE::API::Entities::Entities')
::API::Entities::ApplicationSetting.prepend_if_ee('EE::API::Entities::ApplicationSetting') ::API::Entities::ApplicationSetting.prepend_if_ee('EE::API::Entities::ApplicationSetting')
::API::Entities::Board.prepend_if_ee('EE::API::Entities::Board') ::API::Entities::Board.prepend_if_ee('EE::API::Entities::Board')
::API::Entities::Group.prepend_if_ee('EE::API::Entities::Group', with_descendants: true) ::API::Entities::Group.prepend_if_ee('EE::API::Entities::Group', with_descendants: true)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment