From 665497f5fbdf95a806ca49a2da77aa5c82d5e64a Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 30 Sep 2007 15:32:03 +0000 Subject: [PATCH] Fixed: Manage pu(b)lic queries typo (Thomas Lecavelier). As this fix modifies manage_public_queries permission symbol, this permission has to re-entered. git-svn-id: http://redmine.rubyforge.org/svn/trunk@778 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/queries_controller.rb | 4 ++-- app/models/query.rb | 2 +- app/views/queries/_form.rhtml | 2 +- lib/redmine.rb | 2 +- test/fixtures/roles.yml | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/controllers/queries_controller.rb b/app/controllers/queries_controller.rb index bcc233699..fce001cd8 100644 --- a/app/controllers/queries_controller.rb +++ b/app/controllers/queries_controller.rb @@ -30,7 +30,7 @@ class QueriesController < ApplicationController @query.project = @project @query.user = logged_in_user @query.executed_by = logged_in_user - @query.is_public = false unless current_role.allowed_to?(:manage_pulic_queries) + @query.is_public = false unless current_role.allowed_to?(:manage_public_queries) params[:fields].each do |field| @query.add_filter(field, params[:operators][field], params[:values][field]) @@ -51,7 +51,7 @@ class QueriesController < ApplicationController @query.add_filter(field, params[:operators][field], params[:values][field]) end if params[:fields] @query.attributes = params[:query] - @query.is_public = false unless current_role.allowed_to?(:manage_pulic_queries) + @query.is_public = false unless current_role.allowed_to?(:manage_public_queries) if @query.save flash[:notice] = l(:notice_successful_update) diff --git a/app/models/query.rb b/app/models/query.rb index aaaa1ae73..11460c1cb 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -82,7 +82,7 @@ class Query < ActiveRecord::Base def editable_by?(user) return false unless user return true if !is_public && self.user_id == user.id - is_public && user.allowed_to?(:manage_pulic_queries, project) + is_public && user.allowed_to?(:manage_public_queries, project) end def available_filters diff --git a/app/views/queries/_form.rhtml b/app/views/queries/_form.rhtml index d641fa0b5..28b6479e5 100644 --- a/app/views/queries/_form.rhtml +++ b/app/views/queries/_form.rhtml @@ -5,7 +5,7 @@

<%= text_field 'query', 'name', :size => 80 %>

-<% if current_role.allowed_to?(:manage_pulic_queries) %> +<% if current_role.allowed_to?(:manage_public_queries) %>

<%= check_box 'query', 'is_public' %>

<% end %> diff --git a/lib/redmine.rb b/lib/redmine.rb index 8dd191c33..f70ad8df5 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -36,7 +36,7 @@ Redmine::AccessControl.map do |map| map.permission :move_issues, {:projects => :move_issues}, :require => :loggedin map.permission :delete_issues, {:issues => :destroy}, :require => :member # Queries - map.permission :manage_pulic_queries, {:queries => [:new, :edit, :destroy]}, :require => :member + map.permission :manage_public_queries, {:queries => [:new, :edit, :destroy]}, :require => :member map.permission :save_queries, {:queries => [:new, :edit, :destroy]}, :require => :loggedin # Gantt & calendar map.permission :view_gantt, :projects => :gantt diff --git a/test/fixtures/roles.yml b/test/fixtures/roles.yml index 29eaba3b9..bc4d65641 100644 --- a/test/fixtures/roles.yml +++ b/test/fixtures/roles.yml @@ -62,7 +62,7 @@ roles_001: - :change_issue_status - :move_issues - :delete_issues - - :manage_pulic_queries + - :manage_public_queries - :save_queries - :view_gantt - :view_calendar @@ -100,7 +100,7 @@ roles_002: - :change_issue_status - :move_issues - :delete_issues - - :manage_pulic_queries + - :manage_public_queries - :save_queries - :view_gantt - :view_calendar @@ -138,7 +138,7 @@ roles_003: - :change_issue_status - :move_issues - :delete_issues - - :manage_pulic_queries + - :manage_public_queries - :save_queries - :view_gantt - :view_calendar -- 2.39.5