Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c0af81cd
Commit
c0af81cd
authored
Mar 23, 2020
by
Rajendra Kadam
Committed by
Igor Drozdov
Mar 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate group, member, identity and protected ref access modules into own module files
parent
806841e2
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
93 additions
and
53 deletions
+93
-53
ee/changelogs/unreleased/refactoring-ee-entities-14.yml
ee/changelogs/unreleased/refactoring-ee-entities-14.yml
+5
-0
ee/lib/ee/api/entities.rb
ee/lib/ee/api/entities.rb
+0
-53
ee/lib/ee/api/entities/group.rb
ee/lib/ee/api/entities/group.rb
+23
-0
ee/lib/ee/api/entities/group_detail.rb
ee/lib/ee/api/entities/group_detail.rb
+16
-0
ee/lib/ee/api/entities/identity.rb
ee/lib/ee/api/entities/identity.rb
+15
-0
ee/lib/ee/api/entities/member.rb
ee/lib/ee/api/entities/member.rb
+18
-0
ee/lib/ee/api/entities/protected_ref_access.rb
ee/lib/ee/api/entities/protected_ref_access.rb
+16
-0
No files found.
ee/changelogs/unreleased/refactoring-ee-entities-14.yml
0 → 100644
View file @
c0af81cd
---
title
:
Separate group, member, group_detail and identity modules into own class files
merge_request
:
27797
author
:
Rajendra Kadam
type
:
added
ee/lib/ee/api/entities.rb
View file @
c0af81cd
...
...
@@ -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
...
...
ee/lib/ee/api/entities/group.rb
0 → 100644
View file @
c0af81cd
# 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
ee/lib/ee/api/entities/group_detail.rb
0 → 100644
View file @
c0af81cd
# 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
ee/lib/ee/api/entities/identity.rb
0 → 100644
View file @
c0af81cd
# 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
ee/lib/ee/api/entities/member.rb
0 → 100644
View file @
c0af81cd
# 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
ee/lib/ee/api/entities/protected_ref_access.rb
0 → 100644
View file @
c0af81cd
# 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment