Permalink
Browse files

access_get_status_threshold() returns incorrect value for NEW

When the user's access level is below $g_update_bug_status_threshold and
the status to change to is NEW, the function returned the incorrect
access level, preventing user from accessing the target status when
updating bugs, even though the workflow permits it.

This commit fixes the problem by introducing special handling for NEW
status ('bug_submit_status'), in which case the function returns
'report_bug_threshold' otherwise it falls back to default
'update_bug_status_threshold'.

Fixes #15260, affects issue #15258
  • Loading branch information...
1 parent 0a78482 commit 53844e3621c390da5143364ddbd4c1850181eb2d @dregad dregad committed Dec 6, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 core/access_api.php
View
6 core/access_api.php
@@ -635,6 +635,10 @@ function access_get_status_threshold( $p_status, $p_project_id = ALL_PROJECTS )
if( isset( $t_thresh_array[(int)$p_status] ) ) {
return (int)$t_thresh_array[(int)$p_status];
} else {
- return config_get( 'update_bug_status_threshold', null, null, $p_project_id );
+ if( $p_status == config_get( 'bug_submit_status', null, null, $p_project_id ) ) {
+ return config_get( 'report_bug_threshold', null, null, $p_project_id );
+ } else {
+ return config_get( 'update_bug_status_threshold', null, null, $p_project_id );
+ }
}
}

0 comments on commit 53844e3

Please sign in to comment.