Index: app/helpers/application_helper.rb =================================================================== --- app/helpers/application_helper.rb (revision 15942) +++ app/helpers/application_helper.rb (working copy) @@ -48,7 +48,7 @@ def link_to_user(user, options={}) if user.is_a?(User) name = h(user.name(options[:format])) - if user.active? || (User.current.admin? && user.logged?) + if (user.active? || (User.current.admin? && user.logged?)) && (User.current.admin? && (not User.current.allowed_to?(:hide_public_projects, nil, :global => true))) link_to name, user_path(user), :class => user.css_classes else name Index: app/helpers/projects_helper.rb =================================================================== --- app/helpers/projects_helper.rb (revision 15942) +++ app/helpers/projects_helper.rb (working copy) @@ -48,16 +48,18 @@ def render_project_action_links links = [] - if User.current.allowed_to?(:add_project, nil, :global => true) - links << link_to(l(:label_project_new), new_project_path, :class => 'icon icon-add') + if (not User.current.allowed_to?(:hide_public_projects, nil, :global => true)) + if User.current.allowed_to?(:add_project, nil, :global => true) + links << link_to(l(:label_project_new), new_project_path, :class => 'icon icon-add') + end + if User.current.allowed_to?(:view_issues, nil, :global => true) + links << link_to(l(:label_issue_view_all), issues_path) + end + if User.current.allowed_to?(:view_time_entries, nil, :global => true) + links << link_to(l(:label_overall_spent_time), time_entries_path) + end + links << link_to(l(:label_overall_activity), activity_path) end - if User.current.allowed_to?(:view_issues, nil, :global => true) - links << link_to(l(:label_issue_view_all), issues_path) - end - if User.current.allowed_to?(:view_time_entries, nil, :global => true) - links << link_to(l(:label_overall_spent_time), time_entries_path) - end - links << link_to(l(:label_overall_activity), activity_path) links.join(" | ").html_safe end @@ -64,9 +66,13 @@ # Renders the projects index def render_project_hierarchy(projects) render_project_nested_lists(projects) do |project| - s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}") - if project.description.present? - s << content_tag('div', textilizable(project.short_description, :project => project), :class => 'wiki description') + if (not User.current.logged?) || ((not User.current.admin) && (not User.current.member_of?(project)) && User.current.allowed_to?(:hide_public_projects, nil, :global => true)) + s = "" + else + s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}") + if project.description.present? + s << content_tag('div', textilizable(project.short_description, :project => project), :class => 'wiki description') + end end s end Index: app/views/welcome/index.html.erb =================================================================== --- app/views/welcome/index.html.erb (revision 15942) +++ app/views/welcome/index.html.erb (working copy) @@ -11,7 +11,7 @@ <% end %> <%= call_hook(:view_welcome_index_left, :projects => @projects) %> - + <% content_for :header_tags do %> <%= auto_discovery_link_tag(:atom, {:controller => 'news', :action => 'index', :key => User.current.rss_key, :format => 'atom'}, :title => "#{Setting.app_title}: #{l(:label_news_latest)}") %> Index: lib/redmine.rb =================================================================== --- lib/redmine.rb (revision 15942) +++ lib/redmine.rb (working copy) @@ -76,6 +76,7 @@ # Permissions Redmine::AccessControl.map do |map| map.permission :view_project, {:projects => [:show], :activities => [:index]}, :public => true, :read => true + map.permission :hide_public_projects, {:projects => [:show]}, :require => :loggedin map.permission :search_project, {:search => :index}, :public => true, :read => true map.permission :add_project, {:projects => [:new, :create]}, :require => :loggedin map.permission :edit_project, {:projects => [:settings, :edit, :update]}, :require => :member