Use delegate! on group and project labels policies

parent f98e97fe
class GroupLabelPolicy < BasePolicy class GroupLabelPolicy < BasePolicy
def rules def rules
can! :admin_label if Ability.allowed?(@user, :admin_label, @subject.group) delegate! @subject.group
end end
end end
class ProjectLabelPolicy < BasePolicy class ProjectLabelPolicy < BasePolicy
def rules def rules
can! :admin_label if Ability.allowed?(@user, :admin_label, @subject.project) delegate! @subject.project
end end
end end
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