diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-17 18:08:41 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-17 18:08:41 +0000 |
commit | 22a0d312ae82e7dda3073d5d1a5a766d7641738d (patch) | |
tree | 41a677a7212f24e2f29c2fbd5623430f92fb2b45 /app/models/project_feature.rb | |
parent | 37eff29d5ce44899e34c7c2ac319b314f2f26d15 (diff) | |
download | gitlab-ce-22a0d312ae82e7dda3073d5d1a5a766d7641738d.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/project_feature.rb')
-rw-r--r-- | app/models/project_feature.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/project_feature.rb b/app/models/project_feature.rb index ec097844499..a9753c3c53a 100644 --- a/app/models/project_feature.rb +++ b/app/models/project_feature.rb @@ -22,7 +22,7 @@ class ProjectFeature < ApplicationRecord ENABLED = 20 PUBLIC = 30 - FEATURES = %i(issues merge_requests wiki snippets builds repository pages).freeze + FEATURES = %i(issues forking merge_requests wiki snippets builds repository pages).freeze PRIVATE_FEATURES_MIN_ACCESS_LEVEL = { merge_requests: Gitlab::Access::REPORTER }.freeze PRIVATE_FEATURES_MIN_ACCESS_LEVEL_FOR_PRIVATE_PROJECT = { repository: Gitlab::Access::REPORTER }.freeze STRING_OPTIONS = HashWithIndifferentAccess.new({ @@ -92,6 +92,7 @@ class ProjectFeature < ApplicationRecord default_value_for :builds_access_level, value: ENABLED, allows_nil: false default_value_for :issues_access_level, value: ENABLED, allows_nil: false + default_value_for :forking_access_level, value: ENABLED, allows_nil: false default_value_for :merge_requests_access_level, value: ENABLED, allows_nil: false default_value_for :snippets_access_level, value: ENABLED, allows_nil: false default_value_for :wiki_access_level, value: ENABLED, allows_nil: false @@ -132,6 +133,10 @@ class ProjectFeature < ApplicationRecord merge_requests_access_level > DISABLED end + def forking_enabled? + forking_access_level > DISABLED + end + def issues_enabled? issues_access_level > DISABLED end |