Ability to close projects (read-only) (#3640).
A new permission (Close/reopen project) is available to give non-admin users the ability to close their projects. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9883 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -874,6 +874,18 @@ class UserTest < ActiveSupport::TestCase
|
||||
assert ! @admin.allowed_to?(:view_issues, Project.find(1))
|
||||
end
|
||||
|
||||
should "return false for write action if project is closed" do
|
||||
project = Project.find(1)
|
||||
Project.any_instance.stubs(:status).returns(Project::STATUS_CLOSED)
|
||||
assert ! @admin.allowed_to?(:edit_project, Project.find(1))
|
||||
end
|
||||
|
||||
should "return true for read action if project is closed" do
|
||||
project = Project.find(1)
|
||||
Project.any_instance.stubs(:status).returns(Project::STATUS_CLOSED)
|
||||
assert @admin.allowed_to?(:view_project, Project.find(1))
|
||||
end
|
||||
|
||||
should "return false if related module is disabled" do
|
||||
project = Project.find(1)
|
||||
project.enabled_module_names = ["issue_tracking"]
|
||||
|
||||
Reference in New Issue
Block a user