Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix invalid access denied error caused by access_has_bug_level()

Commit d42e80c changed the code in
access_has_bug_level() function, and introduced a bug in the call to
access_compare_level() when access is limited to issue reporter
(inverted parameters caused an incorrect access denied error).

See also 9ec47a0.

Issue #15538
  • Loading branch information...
commit df411e20948b584b21a7fbc94d84d1ad4073d50b 1 parent 31829a3
@dregad dregad authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 core/access_api.php
View
6 core/access_api.php
@@ -432,15 +432,15 @@ function access_has_bug_level( $p_access_level, $p_bug_id, $p_user_id = null ) {
if( !isset( $s_thresholds[$t_project_id] ) ) {
$t_report_bug_threshold = config_get( 'report_bug_threshold', null, $p_user_id, $t_project_id );
if( !is_array( $t_report_bug_threshold ) ) {
- $s_thresholds[$t_project_id] = $t_report_bug_threshold;
+ $s_thresholds[$t_project_id] = $t_report_bug_threshold + 1;
} else if ( empty( $t_report_bug_threshold ) ) {
$s_thresholds[$t_project_id] = NOBODY;
} else {
sort( $t_report_bug_threshold );
- $s_thresholds[$t_project_id] = $t_report_bug_threshold[0];
+ $s_thresholds[$t_project_id] = $t_report_bug_threshold[0] + 1;
}
}
- if( !access_compare_level( $s_thresholds[$t_project_id], $t_access_level ) ) {
+ if( !access_compare_level( $t_access_level, $s_thresholds[$t_project_id] ) ) {
return false;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.