diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2019-07-26 14:57:12 +0000 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2019-07-26 14:57:12 +0000 |
commit | bd1a5a9f422df267725bd5fbd254f3c1f16fd596 (patch) | |
tree | c32866892bab7a9aeb2def1d76dafd4a17bcb521 /lib/gitlab/project_authorizations/without_nested_groups.rb | |
parent | 900ef6fc316c7d4024545b5d08598c61fa9f3936 (diff) | |
parent | 1ce5bcacdbf56682e05fa63875203bf4d10584bc (diff) | |
download | gitlab-ce-bd1a5a9f422df267725bd5fbd254f3c1f16fd596.tar.gz |
Merge branch 'remove-nested-groups-checks' into 'master'
Remove code related to object hierarchy and MySQL
Closes #65056 and #65055
See merge request gitlab-org/gitlab-ce!31095
Diffstat (limited to 'lib/gitlab/project_authorizations/without_nested_groups.rb')
-rw-r--r-- | lib/gitlab/project_authorizations/without_nested_groups.rb | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/lib/gitlab/project_authorizations/without_nested_groups.rb b/lib/gitlab/project_authorizations/without_nested_groups.rb deleted file mode 100644 index 50b41b17649..00000000000 --- a/lib/gitlab/project_authorizations/without_nested_groups.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -module Gitlab - module ProjectAuthorizations - # Calculating new project authorizations when not supporting nested groups. - class WithoutNestedGroups - attr_reader :user - - # user - The User object for which to calculate the authorizations. - def initialize(user) - @user = user - end - - def calculate - relations = [ - # Projects the user is a direct member of - user.projects.select_for_project_authorization, - - # Personal projects - user.personal_projects.select_as_maintainer_for_project_authorization, - - # Projects of groups the user is a member of - user.groups_projects.select_for_project_authorization, - - # Projects shared with groups the user is a member of - user.groups.joins(:shared_projects).select_for_project_authorization - ] - - ProjectAuthorization - .unscoped - .select_from_union(relations) - end - end - end -end |