Commit 18fd2ccb authored by Kamil Trzcinski's avatar Kamil Trzcinski

Improve cyclomatic of ability::allowed

parent 00526440
......@@ -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?
......
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