From bdf365e64f35e76ba6d9a372111ce502db11827e Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Tue, 11 Oct 2016 13:57:52 -0300 Subject: [PATCH] Use delegate! on group and project labels policies --- app/policies/group_label_policy.rb | 2 +- app/policies/project_label_policy.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/policies/group_label_policy.rb b/app/policies/group_label_policy.rb index 4d4052c5800..7b34aa182eb 100644 --- a/app/policies/group_label_policy.rb +++ b/app/policies/group_label_policy.rb @@ -1,5 +1,5 @@ class GroupLabelPolicy < BasePolicy def rules - can! :admin_label if Ability.allowed?(@user, :admin_label, @subject.group) + delegate! @subject.group end end diff --git a/app/policies/project_label_policy.rb b/app/policies/project_label_policy.rb index e7bd58372a6..b12b4c5166b 100644 --- a/app/policies/project_label_policy.rb +++ b/app/policies/project_label_policy.rb @@ -1,5 +1,5 @@ class ProjectLabelPolicy < BasePolicy def rules - can! :admin_label if Ability.allowed?(@user, :admin_label, @subject.project) + delegate! @subject.project end end