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>
This commit is contained in:
parent
db69111a63
commit
705085db0c
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue