Skip to content

Commit

Permalink
Hide "move" functionality if user has access to just a single project
Browse files Browse the repository at this point in the history
Fixes #26861
  • Loading branch information
atrol authored and dregad committed Apr 18, 2020
1 parent ee8a4e9 commit da3b7ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/bug_group_action_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ function bug_group_action_get_commands( array $p_project_ids = null ) {
$t_update_bug_status_allowed = access_has_project_level( config_get( 'update_bug_status_threshold', null, $t_user_id, $t_project_id ), $t_project_id );

if( !isset( $t_commands['MOVE'] ) &&
user_has_more_than_one_project( $t_user_id ) &&
access_has_project_level( config_get( 'move_bug_threshold', null, $t_user_id, $t_project_id ), $t_project_id ) ) {
$t_commands['MOVE'] = lang_get( 'actiongroup_menu_move' );
}
Expand Down
3 changes: 2 additions & 1 deletion core/commands/IssueViewPageCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ protected function process() {
$t_flags['can_close'] = !$t_issue_readonly &&
access_can_close_bug( $t_issue_data ) && bug_check_workflow( $t_issue_data->status, $t_closed_status );

$t_flags['can_move'] = !$t_issue_readonly && access_has_bug_level( config_get( 'move_bug_threshold' ), $t_issue_id );
$t_flags['can_move'] = !$t_issue_readonly && user_has_more_than_one_project( $t_user_id ) &&
access_has_bug_level( config_get( 'move_bug_threshold' ), $t_issue_id );
$t_flags['can_delete'] = !$t_issue_readonly && access_has_bug_level( config_get( 'delete_bug_threshold' ), $t_issue_id );

if( $t_force_readonly ) {
Expand Down

0 comments on commit da3b7ff

Please sign in to comment.