Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-13 18:07:53 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-13 18:07:53 +0300
commita5ab3467a705b62911feacc3cf627fdbb00aa198 (patch)
tree65143ce13405efccb922fc428624ad57c38b6efa /app/models
parenteb30dd6e28f6fc9eb8021d205f6ed84511f001e2 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/application_setting.rb6
-rw-r--r--app/models/group.rb6
-rw-r--r--app/models/group_group_link.rb4
-rw-r--r--app/models/project_group_link.rb2
4 files changed, 17 insertions, 1 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb
index 3858adfc71f..a0a600a340e 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -169,7 +169,11 @@ class ApplicationSetting < ApplicationRecord
validates :gitaly_timeout_default,
presence: true,
- numericality: { only_integer: true, greater_than_or_equal_to: 0 }
+ numericality: {
+ only_integer: true,
+ greater_than_or_equal_to: 0,
+ less_than_or_equal_to: Settings.gitlab.max_request_duration_seconds
+ }
validates :gitaly_timeout_medium,
presence: true,
diff --git a/app/models/group.rb b/app/models/group.rb
index 8289d4f099c..186253619fe 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -420,6 +420,12 @@ class Group < Namespace
GroupMember.where(source_id: self_and_ancestors_ids, user_id: user.id).order(:access_level).last
end
+ def related_group_ids
+ [id,
+ *ancestors.pluck(:id),
+ *shared_with_group_links.pluck(:shared_with_group_id)]
+ end
+
def hashed_storage?(_feature)
false
end
diff --git a/app/models/group_group_link.rb b/app/models/group_group_link.rb
index 4b279b7af5b..5a0d9b08cb0 100644
--- a/app/models/group_group_link.rb
+++ b/app/models/group_group_link.rb
@@ -20,4 +20,8 @@ class GroupGroupLink < ApplicationRecord
def self.default_access
Gitlab::Access::DEVELOPER
end
+
+ def human_access
+ Gitlab::Access.human_access(self.group_access)
+ end
end
diff --git a/app/models/project_group_link.rb b/app/models/project_group_link.rb
index 0d3a2d4e398..b70c07a8386 100644
--- a/app/models/project_group_link.rb
+++ b/app/models/project_group_link.rb
@@ -21,6 +21,8 @@ class ProjectGroupLink < ApplicationRecord
after_commit :refresh_group_members_authorized_projects
+ alias_method :shared_with_group, :group
+
def self.access_options
Gitlab::Access.options
end