Commit 424778d6 authored by Igor Drozdov's avatar Igor Drozdov

Merge branch 'refactoring-ee-entities-14' into 'master'

Separate group, member, identity and protected ref access modules into own module files

See merge request gitlab-org/gitlab!27797
parents 635167ac c0af81cd
---
title: Separate group, member, group_detail and identity modules into own class files
merge_request: 27797
author: Rajendra Kadam
type: added
......@@ -3,59 +3,6 @@
module EE
module API
module Entities
module Group
extend ActiveSupport::Concern
prepended do
expose :ldap_cn, :ldap_access
expose :ldap_group_links,
using: EE::API::Entities::LdapGroupLink,
if: ->(group, options) { group.ldap_group_links.any? }
expose :checked_file_template_project_id,
as: :file_template_project_id,
if: ->(group, options) { group.feature_available?(:custom_file_templates_for_namespace) }
expose :marked_for_deletion_on, if: ->(group, _) { group.feature_available?(:adjourned_deletion_for_projects_and_groups) }
end
end
module GroupDetail
extend ActiveSupport::Concern
prepended do
expose :shared_runners_minutes_limit
expose :extra_shared_runners_minutes_limit
end
end
module Identity
extend ActiveSupport::Concern
prepended do
expose :saml_provider_id
end
end
module Member
extend ActiveSupport::Concern
prepended do
expose :group_saml_identity,
using: ::API::Entities::Identity,
if: -> (member, options) { Ability.allowed?(options[:current_user], :read_group_saml_identity, member.source) }
expose :is_using_seat, if: -> (_, options) { options[:show_seat_info] }
end
end
module ProtectedRefAccess
extend ActiveSupport::Concern
prepended do
expose :user_id
expose :group_id
end
end
module ProtectedBranch
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module EE
module API
module Entities
module Group
extend ActiveSupport::Concern
prepended do
expose :ldap_cn, :ldap_access
expose :ldap_group_links,
using: EE::API::Entities::LdapGroupLink,
if: ->(group, options) { group.ldap_group_links.any? }
expose :checked_file_template_project_id,
as: :file_template_project_id,
if: ->(group, options) { group.feature_available?(:custom_file_templates_for_namespace) }
expose :marked_for_deletion_on, if: ->(group, _) { group.feature_available?(:adjourned_deletion_for_projects_and_groups) }
end
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
module GroupDetail
extend ActiveSupport::Concern
prepended do
expose :shared_runners_minutes_limit
expose :extra_shared_runners_minutes_limit
end
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
module Identity
extend ActiveSupport::Concern
prepended do
expose :saml_provider_id
end
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
module Member
extend ActiveSupport::Concern
prepended do
expose :group_saml_identity,
using: ::API::Entities::Identity,
if: -> (member, options) { Ability.allowed?(options[:current_user], :read_group_saml_identity, member.source) }
expose :is_using_seat, if: -> (_, options) { options[:show_seat_info] }
end
end
end
end
end
# frozen_string_literal: true
module EE
module API
module Entities
module ProtectedRefAccess
extend ActiveSupport::Concern
prepended do
expose :user_id
expose :group_id
end
end
end
end
end
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