diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-05-08 15:07:55 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-05-10 17:02:27 +0200 |
commit | f7f13f9db0da92c7b43481dfe5559f317711e533 (patch) | |
tree | 59359aecb555f844de1a81a0aebbd70336fbb8c1 /app/models | |
parent | f667bbceaba7556d5fb2adadce4b7d170b914e8a (diff) | |
download | gitlab-ce-f7f13f9db0da92c7b43481dfe5559f317711e533.tar.gz |
Block access to API & git when terms are enforced
When terms are enforced, but the user has not accepted the terms
access to the API & git is rejected with a message directing the user
to the web app to accept the terms.
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/user.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index a9cfd39f604..884f3bbb364 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1193,6 +1193,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 |