Skip to content

Commit ddfd7d9

Browse files
committed
Only attach Issues to changeset if authorized
A user having Update threshold can attach *any* Issue to a Changeset, even if they do not have access to it (i.e. private Issue), by entering the Issue's Id. Fixes #344
1 parent 2f96a4a commit ddfd7d9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Source/pages/attach.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@
1616
$t_user_id = auth_get_current_user_id();
1717

1818
$t_bug_ids = explode( ',', $f_bug_ids );
19+
$t_view_bug_threshold = config_get('view_bug_threshold');
1920
foreach( $t_bug_ids as $t_bug_id ) {
2021
$t_bug_id = (int) $t_bug_id;
2122

22-
if ( $t_bug_id < 1 || !bug_exists( $t_bug_id ) ) {
23+
if ( $t_bug_id < 1
24+
|| !bug_exists( $t_bug_id )
25+
|| !access_has_bug_level( $t_view_bug_threshold, $t_bug_id )
26+
) {
2327
continue;
2428
}
2529

0 commit comments

Comments
 (0)