Adds a role setting that viewing all or own time entries (#8929).

git-svn-id: http://svn.redmine.org/redmine/trunk@14275 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2015-05-30 07:40:57 +00:00
parent 5e28f0b1b6
commit 6659aad3ef
12 changed files with 100 additions and 7 deletions

View File

@@ -143,7 +143,7 @@ class ProjectsController < ApplicationController
@open_issues_by_tracker = Issue.visible.open.where(cond).group(:tracker).count
@total_issues_by_tracker = Issue.visible.where(cond).group(:tracker).count
if User.current.allowed_to?(:view_time_entries, @project)
if User.current.allowed_to_view_all_time_entries?(@project)
@total_hours = TimeEntry.visible.where(cond).sum(:hours).to_f
end