summaryrefslogtreecommitdiff
path: root/app/policies
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-11 13:57:52 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-19 14:58:26 -0200
commitbdf365e64f35e76ba6d9a372111ce502db11827e (patch)
tree20438baa7bbeba2838067e2a2b74ebd359ea1ce1 /app/policies
parentf98e97fe78dce11a1f88c3961be402d179e63927 (diff)
downloadgitlab-ce-bdf365e64f35e76ba6d9a372111ce502db11827e.tar.gz
Use delegate! on group and project labels policies
Diffstat (limited to 'app/policies')
-rw-r--r--app/policies/group_label_policy.rb2
-rw-r--r--app/policies/project_label_policy.rb2
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