summaryrefslogtreecommitdiff
path: root/app/models/ability.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-06-15 12:12:26 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-06-15 12:12:26 +0200
commit18fd2ccb8b9b60e2acd6782a4160f85d3ee6c95f (patch)
tree1637aa45423d2a3c13c0a531acfda39f0aecf743 /app/models/ability.rb
parent00526440092bb82beb86b87376dd1ea6178bf05f (diff)
downloadgitlab-ce-18fd2ccb8b9b60e2acd6782a4160f85d3ee6c95f.tar.gz
Improve cyclomatic of ability::allowed
Diffstat (limited to 'app/models/ability.rb')
-rw-r--r--app/models/ability.rb16
1 files changed, 1 insertions, 15 deletions
diff --git a/app/models/ability.rb b/app/models/ability.rb
index 734b152605b..8d76e8efa13 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -9,7 +9,6 @@ class Ability
when CommitStatus then commit_status_abilities(user, subject)
when Project then project_abilities(user, subject)
when Issue then issue_abilities(user, subject)
- when ExternalIssue then external_issue_abilities(user, subject)
when Note then note_abilities(user, subject)
when ProjectSnippet then project_snippet_abilities(user, subject)
when PersonalSnippet then personal_snippet_abilities(user, subject)
@@ -18,9 +17,8 @@ class Ability
when Namespace then namespace_abilities(user, subject)
when GroupMember then group_member_abilities(user, subject)
when ProjectMember then project_member_abilities(user, subject)
- when Deployment then deployment_abilities(user, subject)
- when Environment then environment_abilities(user, subject)
when User then user_abilities
+ when ExternalIssue, Deployment, Environment then project_abilities(user, subject.project)
else []
end.concat(global_abilities(user))
end
@@ -523,18 +521,6 @@ class Ability
end
end
- def external_issue_abilities(user, subject)
- project_abilities(user, subject.project)
- end
-
- def deployment_abilities(user, subject)
- project_abilities(user, subject.project)
- end
-
- def environment_abilities(user, subject)
- project_abilities(user, subject.project)
- end
-
private
def restricted_public_level?