jbox-web/redmine_git_hosting

View on GitHub
app/controllers/archived_repositories_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

class ArchivedRepositoriesController < RepositoriesController
  skip_before_action :authorize
  skip_before_action :find_project_repository, only: :index

  before_action :can_view_archived_projects

  def index
    @archived_projects = Project.where(status: Project::STATUS_ARCHIVED)
                                .includes(:repositories)
  end

  private

  def can_view_archived_projects
    render_403 unless User.current.admin?
  end
end