diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-11-14 12:08:47 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-11-14 12:08:47 +0000 |
commit | dfd02040521b84c64e9aa5d7b70ccfa427ffe841 (patch) | |
tree | a10651d01952dbcd83ede78d7a2d4f5a7a0028cd /app | |
parent | 326ed79b432a3c0172cfbe0eaf801645e7b2e2c6 (diff) | |
download | redmine-dfd02040521b84c64e9aa5d7b70ccfa427ffe841.tar.gz redmine-dfd02040521b84c64e9aa5d7b70ccfa427ffe841.zip |
Add view_issues permission (#3187).
A migration adds this permission to all existing roles to preserve current behaviour.
This permission controls access to issues, roadmap and changelog.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3039 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/search_controller.rb | 2 | ||||
-rw-r--r-- | app/helpers/application_helper.rb | 2 | ||||
-rw-r--r-- | app/views/projects/index.rhtml | 2 | ||||
-rw-r--r-- | app/views/repositories/revision.rhtml | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 485d2349d..68687347e 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -43,7 +43,7 @@ class SearchController < ApplicationController begin; offset = params[:offset].to_time if params[:offset]; rescue; end # quick jump to an issue - if @question.match(/^#?(\d+)$/) && Issue.find_by_id($1, :include => :project, :conditions => Project.visible_by(User.current)) + if @question.match(/^#?(\d+)$/) && Issue.visible.find_by_id($1) redirect_to :controller => "issues", :action => "show", :id => $1 return end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index cacfe2986..6fca5ea7c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -480,7 +480,7 @@ module ApplicationHelper oid = oid.to_i case prefix when nil - if issue = Issue.find_by_id(oid, :include => [:project, :status], :conditions => Project.visible_by(User.current)) + if issue = Issue.visible.find_by_id(oid, :include => :status) link = link_to("##{oid}", {:only_path => only_path, :controller => 'issues', :action => 'show', :id => oid}, :class => (issue.closed? ? 'issue closed' : 'issue'), :title => "#{truncate(issue.subject, :length => 100)} (#{issue.status.name})") diff --git a/app/views/projects/index.rhtml b/app/views/projects/index.rhtml index 3b2435799..11e9bcd33 100644 --- a/app/views/projects/index.rhtml +++ b/app/views/projects/index.rhtml @@ -1,6 +1,6 @@ <div class="contextual"> <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'add'}, :class => 'icon icon-add') + ' |' if User.current.allowed_to?(:add_project, nil, :global => true) %> - <%= link_to l(:label_issue_view_all), { :controller => 'issues' } %> | + <%= link_to(l(:label_issue_view_all), { :controller => 'issues' }) + ' |' if User.current.allowed_to?(:view_issues, nil, :global => true) %> <%= link_to l(:label_overall_activity), { :controller => 'projects', :action => 'activity' }%> </div> diff --git a/app/views/repositories/revision.rhtml b/app/views/repositories/revision.rhtml index f992f046d..b7bda4530 100644 --- a/app/views/repositories/revision.rhtml +++ b/app/views/repositories/revision.rhtml @@ -26,10 +26,10 @@ <%= textilizable @changeset.comments %> -<% if @changeset.issues.any? %> +<% if @changeset.issues.visible.any? %> <h3><%= l(:label_related_issues) %></h3> <ul> -<% @changeset.issues.each do |issue| %> +<% @changeset.issues.visible.each do |issue| %> <li><%= link_to_issue issue %>: <%=h issue.subject %></li> <% end %> </ul> |