diff options
author | http://jneen.net/ <jneen@jneen.net> | 2016-08-18 09:59:17 -0700 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2016-08-30 11:39:22 -0700 |
commit | a340829c42617b40696408c3097d6476970e8b87 (patch) | |
tree | e43b843da5aa060af7a771b1abefe59c40c843db /app/policies | |
parent | 5019185edd7718b262eb5ae94f21763f230f0557 (diff) | |
download | gitlab-ce-a340829c42617b40696408c3097d6476970e8b87.tar.gz |
port UserPolicy
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/user_policy.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/policies/user_policy.rb b/app/policies/user_policy.rb new file mode 100644 index 00000000000..03a2499e263 --- /dev/null +++ b/app/policies/user_policy.rb @@ -0,0 +1,11 @@ +class UserPolicy < BasePolicy + include Gitlab::CurrentSettings + + def rules + can! :read_user if @user || !restricted_public_level? + end + + def restricted_public_level? + current_application_settings.restricted_visibility_levels.include?(Gitlab::VisibilityLevel::PUBLIC) + end +end |