Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-08-04 17:00:31 +0300
committerRémy Coutable <remy@rymai.me>2016-08-04 17:00:31 +0300
commit705085db0c3b869f62f1b0f742686cc2082001fa (patch)
treed4e0c79de77f0c7b9fc3335bf0eba425652406d3 /app/models/ability.rb
parentdb69111a63cfadb31cc02cf4400d743a913bdfbd (diff)
Move abilities by subject class to a dedicated method
This will avoid lame conflicts when merging CE to EE Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/models/ability.rb')
-rw-r--r--app/models/ability.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/ability.rb b/app/models/ability.rb
index d95a2507199..d9113ffd99a 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -6,6 +6,10 @@ class Ability
return [] unless user.is_a?(User)
return [] if user.blocked?
+ abilities_by_subject_class(user: user, subject: subject)
+ end
+
+ def abilities_by_subject_class(user:, subject:)
case subject
when CommitStatus then commit_status_abilities(user, subject)
when Project then project_abilities(user, subject)