From 37c401433b76170f0150d70865f1f4584db01fa8 Mon Sep 17 00:00:00 2001 From: "http://jneen.net/" Date: Thu, 6 Apr 2017 14:06:42 -0700 Subject: convert all the policies to DeclarativePolicy --- app/models/project_feature.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/models/project_feature.rb') diff --git a/app/models/project_feature.rb b/app/models/project_feature.rb index 48edd0738ee..c8fabb16dc1 100644 --- a/app/models/project_feature.rb +++ b/app/models/project_feature.rb @@ -51,8 +51,11 @@ class ProjectFeature < ActiveRecord::Base default_value_for :repository_access_level, value: ENABLED, allows_nil: false def feature_available?(feature, user) - access_level = public_send(ProjectFeature.access_level_attribute(feature)) - get_permission(user, access_level) + get_permission(user, access_level(feature)) + end + + def access_level(feature) + public_send(ProjectFeature.access_level_attribute(feature)) end def builds_enabled? -- cgit v1.2.1