Permalink
Browse files

Print pages: don't show custom fields user has no access to

Prior to this, if a custom field's 'read' access level were higher than
the user's access, the print pages would display the field's label (but
not the data). This behavior is not consistent with how this situation
is handled in the View Issue page, where the field is not shown at all.

For consistency, we now skip the of the custom field users have no read
access to in the print pages, so that nothing is displayed.

Fixes #15528
  • Loading branch information...
1 parent f583a45 commit 0c36ea7308154cf48817f4843a3d11c34a4cb16d @dregad dregad committed Mar 5, 2013
Showing with 10 additions and 0 deletions.
  1. +5 −0 print_all_bug_page_word.php
  2. +5 −0 print_bug_page.php
@@ -387,6 +387,11 @@
<?php
$t_related_custom_field_ids = custom_field_get_linked_ids( $t_bug->project_id );
foreach( $t_related_custom_field_ids as $t_custom_field_id ) {
+ # Don't display the field if user does not have read access to it
+ if ( !custom_field_has_read_access_by_project_id( $t_custom_field_id, $t_bug->project_id ) ) {
+ continue;
+ }
+
$t_def = custom_field_get_definition( $t_custom_field_id );
?>
<tr class="print">
View
@@ -450,6 +450,11 @@
$t_related_custom_field_ids = custom_field_get_linked_ids( $tpl_bug->project_id );
foreach( $t_related_custom_field_ids as $t_id ) {
+ # Don't display the field if user does not have read access to it
+ if ( !custom_field_has_read_access_by_project_id( $t_id, $tpl_bug->project_id ) ) {
+ continue;
+ }
+
$t_def = custom_field_get_definition( $t_id );
echo '<tr class="print">';

0 comments on commit 0c36ea7

Please sign in to comment.