Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 179bfc016596bf11cb4ac1e3bb6d76acbac30aa0 1 parent 1dcb3a9
@dregad dregad authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 core/access_api.php
View
6 core/access_api.php
@@ -641,6 +641,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 );
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.