Commit 705085db authored by Rémy Coutable's avatar Rémy Coutable

Move abilities by subject class to a dedicated method

This will avoid lame conflicts when merging CE to EE
Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent db69111a
...@@ -6,6 +6,10 @@ class Ability ...@@ -6,6 +6,10 @@ class Ability
return [] unless user.is_a?(User) return [] unless user.is_a?(User)
return [] if user.blocked? return [] if user.blocked?
abilities_by_subject_class(user: user, subject: subject)
end
def abilities_by_subject_class(user:, subject:)
case subject case subject
when CommitStatus then commit_status_abilities(user, subject) when CommitStatus then commit_status_abilities(user, subject)
when Project then project_abilities(user, subject) when Project then project_abilities(user, subject)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment