diff --git a/app/controllers/projects/protected_branches_controller.rb b/app/controllers/projects/protected_branches_controller.rb index a245a60910e..c2a55c9500a 100644 --- a/app/controllers/projects/protected_branches_controller.rb +++ b/app/controllers/projects/protected_branches_controller.rb @@ -1,5 +1,4 @@ class Projects::ProtectedBranchesController < Projects::ProtectedRefsController - protected def protected_ref diff --git a/app/controllers/projects/protected_tags_controller.rb b/app/controllers/projects/protected_tags_controller.rb index 8f407b42ac8..ff132056aa4 100644 --- a/app/controllers/projects/protected_tags_controller.rb +++ b/app/controllers/projects/protected_tags_controller.rb @@ -1,5 +1,4 @@ class Projects::ProtectedTagsController < Projects::ProtectedRefsController - protected def protected_ref diff --git a/app/controllers/projects/settings/repository_controller.rb b/app/controllers/projects/settings/repository_controller.rb index fb175b4a636..ff818d9e51a 100644 --- a/app/controllers/projects/settings/repository_controller.rb +++ b/app/controllers/projects/settings/repository_controller.rb @@ -19,7 +19,6 @@ module Projects load_gon_index end - def access_levels_options #TODO: consider protected tags #TODO: Refactor ProtectedBranch::PushAccessLevel so it doesn't mention branches diff --git a/app/models/concerns/protected_ref.rb b/app/models/concerns/protected_ref.rb index 3681ae63e3a..f6841669ab0 100644 --- a/app/models/concerns/protected_ref.rb +++ b/app/models/concerns/protected_ref.rb @@ -9,13 +9,13 @@ module ProtectedRef delegate :matching, :matches?, :wildcard?, to: :ref_matcher def self.matching_refs_accesible_to(ref, user, action: :push) - access_levels_for_ref(ref, action).any? do |access_level| + access_levels_for_ref(ref, action: action).any? do |access_level| access_level.check_access(user) end end def self.access_levels_for_ref(ref, action: :push) - self.matching(ref).map(&:"@#{action}_access_levels").flatten + self.matching(ref).map(&:"#{action}_access_levels").flatten end def self.matching(ref_name, protected_refs: nil)