Permalink
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...
1 parent 910546d commit f583a4582f23e8369777eac6fce2bb8275d93726 @dregad dregad committed Feb 27, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 core/access_api.php
View
@@ -427,15 +427,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;
}
}

0 comments on commit f583a45

Please sign in to comment.