summaryrefslogtreecommitdiff
path: root/app/models/ability.rb
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2016-08-18 09:59:17 -0700
committerhttp://jneen.net/ <jneen@jneen.net>2016-08-30 11:39:22 -0700
commita340829c42617b40696408c3097d6476970e8b87 (patch)
treee43b843da5aa060af7a771b1abefe59c40c843db /app/models/ability.rb
parent5019185edd7718b262eb5ae94f21763f230f0557 (diff)
downloadgitlab-ce-a340829c42617b40696408c3097d6476970e8b87.tar.gz
port UserPolicy
Diffstat (limited to 'app/models/ability.rb')
-rw-r--r--app/models/ability.rb11
1 files changed, 0 insertions, 11 deletions
diff --git a/app/models/ability.rb b/app/models/ability.rb
index 7c4210f0706..fe171cd1a8b 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -73,7 +73,6 @@ class Ability
def abilities_by_subject_class(user:, subject:)
case subject
- when User then user_abilities
when ExternalIssue, Deployment, Environment then project_abilities(user, subject.project)
else []
end + global_abilities(user)
@@ -85,17 +84,11 @@ class Ability
ProjectPolicy.abilities(nil, subject.project)
elsif subject.respond_to?(:group)
GroupPolicy.abilities(nil, subject.group)
- elsif subject.is_a?(User)
- anonymous_user_abilities
else
[]
end
end
- def anonymous_user_abilities
- [:read_user] unless restricted_public_level?
- end
-
def global_abilities(user)
rules = []
rules << :create_group if user.can_create_group
@@ -136,10 +129,6 @@ class Ability
rules
end
- def user_abilities
- [:read_user]
- end
-
def restricted_public_level?
current_application_settings.restricted_visibility_levels.include?(Gitlab::VisibilityLevel::PUBLIC)
end