diff --git a/core_user_API.php b/core_user_API.php index 8e8c0237a6..dafaea5c5f 100644 --- a/core_user_API.php +++ b/core_user_API.php @@ -322,7 +322,10 @@ function access_level_check_equal( $p_access_level ) { $t_access_level = get_current_user_field( "access_level" ); $t_access_level2 = get_project_access_level(); - if ( ( $t_access_level == $p_access_level ) || ( $t_access_level2 == $p_access_level ) ) { + if ( $t_access_level2 == $p_access_level ) { + return true; + } else if ( ( $t_access_level == $p_access_level ) && + ( -1 == $t_access_level2 ) ) { return true; } else { return false; @@ -343,9 +346,7 @@ function access_level_check_greater_or_equal( $p_access_level ) { # use the project level access level instead of the global access level # if the project level is not specified then use the global access level - if ( -1 == $t_access_level2 ) { - # do nothing - } else if ( $t_access_level2 > $t_access_level ) { + if ( -1 != $t_access_level2 ) { $t_access_level = $t_access_level2; } diff --git a/doc/ChangeLog b/doc/ChangeLog index 04f3e53f8b..bea3b8e158 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -23,6 +23,7 @@ Mantis * Fixed file upload switch with break statements. * Fixed print_assign_to_option_list() to accurately reflect settings. * Fixed print_reporter_option_list() to accurately reflect settings. + * Fixed the access level checks to be more accurate. * Removed site_settings link in print_manage_doc_menu(). * Renamed doc/CONFIGURATION to doc/CUSTOMIZATION. * Modified edit user links to use the username instead of the [edit] link.