View Issue Details

IDProjectCategoryView StatusLast Update
0013778mantisbttime trackingpublic2013-10-31 11:46
ReporterTomR Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version1.2.8 
Summary0013778: Time Tracking report does not use $g_time_tracking_reporting_threshold
Description

Would like to show to all >= VIEWER time information per issue as well as the report. However only >= DEVELOPER should be able to edit time for an issue.

For individual issues this is working as expected.
However the report is is not filtering out the issues ( and notes ) based on the projects the user has access to. It will show all the issues with summary, which it should not. The totals therefore are incorrect.

$g_time_tracking_view_threshold = VIEWER;
$g_time_tracking_edit_threshold = DEVELOPER;
$g_time_tracking_reporting_threshold = VIEWER;

TagsNo tags attached.

Activities

dominik

dominik

2012-01-20 09:37

reporter   ~0030975

I can confirm that report shows issues from "all projects", not only "all where user has access to". At least when user selects "all projects" or user has only one project assigned...

dominik

dominik

2012-01-20 10:30

reporter   ~0030976

Last edited: 2012-01-20 10:40

Quick solution: Change bugnote_api.php (Line 675+)

from:

if( ALL_PROJECTS != $c_project_id ) {
$t_project_where = " AND b.project_id = '$c_project_id' AND bn.bug_id = b.id ";
} else {
$t_project_where = '';
}

to:

if( ALL_PROJECTS != $c_project_id ) {
$t_project_where_ids = $c_project_id;
} else {
$t_project_where_ids = implode( ', ', user_get_accessible_projects( auth_get_current_user_id() ) );
}
if ( user_is_administrator( auth_get_current_user_id() ) ) {
$t_project_where = '';
}
else {
$t_project_where = " AND b.project_id in (" . $t_project_where_ids . ") AND bn.bug_id = b.id ";
}

TomR

TomR

2012-01-20 12:55

reporter   ~0030980

Last edited: 2013-10-19 05:16

Thanks Dominik. Ik can verify that the problem now is solved voor All Projects. However private issues are still shown when selecting the project ( which the user has access to, but not to the private issue ).

In this case I have to decide where to enforce access rules. It seems odd to count issues or bugnotes into a total when you do not have acces to the individual issue orr bugnote ( marked as private ).

dregad

dregad

2012-01-20 20:32

developer   ~0030982

Dominik: with your fix, Administrators can no longer view time tracking data for a specific project, it will always display data for all projects. It may also be worth considering the case of sub-projects.

TomR: I think you are correct that the Private bugs and notes should only be counted if user has access to them. However, I am afraid that properly handling that would be quite complex.

If you propose a patch I'll have a look at it.

AbsolutelyFreeWeb

AbsolutelyFreeWeb

2013-10-31 11:45

reporter   ~0038403

Last edited: 2013-10-31 11:46

May I suggest look into the time tracking plugin, which I don't think has any permission problems. As far as I know, the old time tracking within mantisbt is obsolete. https://github.com/mantisbt-plugins/timetracking