summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/ability.rb22
1 files changed, 12 insertions, 10 deletions
diff --git a/app/models/ability.rb b/app/models/ability.rb
index f33c8d61d3f..7fd32d59270 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -25,6 +25,14 @@ class Ability
end.concat(global_abilities(user))
end
+ def abilities
+ @abilities ||= begin
+ abilities = Six.new
+ abilities << self
+ abilities
+ end
+ end
+
# Given a list of users and a project this method returns the users that can
# read the given project.
def users_that_can_read_project(users, project)
@@ -47,6 +55,10 @@ class Ability
end
end
+ private
+
+
+
# List of possible abilities for anonymous user
def anonymous_abilities(user, subject)
if subject.is_a?(PersonalSnippet)
@@ -543,16 +555,6 @@ class Ability
[:read_user]
end
- def abilities
- @abilities ||= begin
- abilities = Six.new
- abilities << self
- abilities
- end
- end
-
- private
-
def restricted_public_level?
current_application_settings.restricted_visibility_levels.include?(Gitlab::VisibilityLevel::PUBLIC)
end