mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-29 19:59:38 +00:00
Let admins unarchive the project when trying to access an archived project (#29993).
git-svn-id: http://svn.redmine.org/redmine/trunk@17682 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
12d1372ae5
commit
3ba51f205d
@ -259,6 +259,7 @@ class ApplicationController < ActionController::Base
|
||||
true
|
||||
else
|
||||
if @project && @project.archived?
|
||||
@archived_project = @project
|
||||
render_403 :message => :notice_not_authorized_archived_project
|
||||
elsif @project && !@project.allows_to?(:controller => ctrl, :action => action)
|
||||
# Project module is disabled
|
||||
|
||||
@ -3,6 +3,11 @@
|
||||
<% if @message.present? %>
|
||||
<p id="errorExplanation"><%= @message %></p>
|
||||
<% end %>
|
||||
|
||||
<% if @archived_project && User.current.admin? %>
|
||||
<p><%= link_to l(:button_unarchive), unarchive_project_path(@archived_project), :method => :post, :class => 'icon icon-unlock' %></p>
|
||||
<% end %>
|
||||
|
||||
<p><a href="javascript:history.back()"><%= l(:button_back) %></a></p>
|
||||
|
||||
<% html_title @status %>
|
||||
|
||||
@ -524,9 +524,9 @@ class ProjectsControllerTest < Redmine::ControllerTest
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
def show_archived_project_should_be_denied
|
||||
def test_show_archived_project_should_be_denied
|
||||
project = Project.find_by_identifier('ecookbook')
|
||||
project.archive!
|
||||
project.archive
|
||||
|
||||
get :show, :params => {
|
||||
:id => 'ecookbook'
|
||||
@ -536,6 +536,18 @@ class ProjectsControllerTest < Redmine::ControllerTest
|
||||
assert_not_include project.name, response.body
|
||||
end
|
||||
|
||||
def test_show_archived_project_should_show_unarchive_link_to_admins
|
||||
@request.session[:user_id] = 1
|
||||
project = Project.find_by_identifier('ecookbook')
|
||||
project.archive
|
||||
|
||||
get :show, :params => {
|
||||
:id => 'ecookbook'
|
||||
}
|
||||
assert_response 403
|
||||
assert_select 'a', :text => "Unarchive"
|
||||
end
|
||||
|
||||
def test_show_should_not_show_private_subprojects_that_are_not_visible
|
||||
get :show, :params => {
|
||||
:id => 'ecookbook'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user