diff options
author | Andrew8xx8 <avk@8xx8.ru> | 2013-03-25 02:17:03 +0400 |
---|---|---|
committer | Andrew8xx8 <avk@8xx8.ru> | 2013-03-25 02:17:03 +0400 |
commit | e90aebe259b1f81cb2523099cab4626b9276e751 (patch) | |
tree | 154f278a7619a15720a3df3f6c6c53081f0a63a7 /app/models/ability.rb | |
parent | 9bd1983e167c7a040565d8e03a20364455bddd59 (diff) | |
download | gitlab-ce-e90aebe259b1f81cb2523099cab4626b9276e751.tar.gz |
Personal snippets controlelr refactored
Diffstat (limited to 'app/models/ability.rb')
-rw-r--r-- | app/models/ability.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/ability.rb b/app/models/ability.rb index 928b36e6c80..2dadb584460 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -8,7 +8,7 @@ class Ability when "Issue" then issue_abilities(user, subject) when "Note" then note_abilities(user, subject) when "ProjectSnippet" then project_snippet_abilities(user, subject) - when "Snippet" then snippet_abilities(user, subject) + when "PersonalSnippet" then personal_snippet_abilities(user, subject) when "MergeRequest" then merge_request_abilities(user, subject) when "Group", "Namespace" then group_abilities(user, subject) when "UserTeam" then user_team_abilities(user, subject) @@ -135,8 +135,7 @@ class Ability rules.flatten end - - [:issue, :note, :project_snippet, :snippet, :merge_request].each do |name| + [:issue, :note, :project_snippet, :personal_snippet, :merge_request].each do |name| define_method "#{name}_abilities" do |user, subject| if subject.author == user [ |