summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZ.J. van de Weg <zegerjan@gitlab.com>2016-07-26 09:43:46 +0200
committerZ.J. van de Weg <zegerjan@gitlab.com>2016-07-26 15:18:49 +0200
commit8c6d4c2b291aa16f666e589f6c4f573d3a575a3d (patch)
tree8e50d99698eab9a6e289dca8875a06874510f8fb
parent68162ba900f1b9003fa3d07613333f201be8154a (diff)
downloadgitlab-ce-zj-abilities-poc.tar.gz
Make most methods private in the Abilities Modelzj-abilities-poc
-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