Skip to content
Snippets Groups Projects
Commit 18fd2ccb authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Improve cyclomatic of ability::allowed

parent 00526440
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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)
Loading
Loading
@@ -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
Loading
Loading
@@ -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?
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment