summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-05-11 14:37:14 +0000
committerDouwe Maan <douwe@gitlab.com>2018-05-11 14:37:14 +0000
commit0842ab8746a926fe85f27945c7c24ea2520f75a1 (patch)
tree15c3a7f6da655354ee86025efb9ca198defaf1c2 /app/models
parent26b1ba12ef147cf78b8f2c60a959e5107bebeaec (diff)
parente0768a9bcb32e81fe18a77b21573969f45b47683 (diff)
downloadgitlab-ce-0842ab8746a926fe85f27945c7c24ea2520f75a1.tar.gz
Merge branch 'bvl-restrict-api-git-for-terms' into 'master'
Block access to API & git when terms are enforced Closes #45849 See merge request gitlab-org/gitlab-ce!18816
Diffstat (limited to 'app/models')
-rw-r--r--app/models/user.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index d74d5aade5a..dfef065f094 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1197,6 +1197,11 @@ class User < ActiveRecord::Base
accepted_term_id.present?
end
+ def required_terms_not_accepted?
+ Gitlab::CurrentSettings.current_application_settings.enforce_terms? &&
+ !terms_accepted?
+ end
+
protected
# override, from Devise::Validatable