protected_tags_controller.rb 672 Bytes
Newer Older
1 2
class Projects::ProtectedTagsController < Projects::ProtectedRefsController
  protected
3

4 5
  def protected_ref
    @protected_tag
6 7
  end

8 9
  def protected_ref=(val)
    @protected_tag = val
10 11
  end

12 13
  def matching_refs=(val)
    @matching_tags = val
14 15
  end

16 17
  def project_refs
    @project.repository.tags
18 19
  end

20 21
  def create_service
    ::ProtectedTags::CreateService
22 23
  end

24 25 26
  def update_service
    ::ProtectedTags::UpdateService
  end
27

28 29
  def load_protected_ref
    self.protected_ref = @project.protected_tags.find(params[:id])
30 31
  end

32
  def protected_ref_params
33
    params.require(:protected_tag).permit(:name, create_access_levels_attributes: [:access_level, :id])
34 35
  end
end