Use delegate! on group and project labels policies
This commit is contained in:
parent
f98e97fe78
commit
bdf365e64f
|
@ -1,5 +1,5 @@
|
||||||
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
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue