[Rt-commit] rt branch 5.0/self-service-txn-display-paths created. rt-5.0.5-114-g4e70c06397
BPS Git Server
git at git.bestpractical.com
Wed Jan 10 15:20:11 UTC 2024
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".
The branch, 5.0/self-service-txn-display-paths has been created
at 4e70c0639706c26bdcfafb4d8c6ffbef625ea642 (commit)
- Log -----------------------------------------------------------------
commit 4e70c0639706c26bdcfafb4d8c6ffbef625ea642
Author: sunnavy <sunnavy at bestpractical.com>
Date: Wed Jan 10 05:30:00 2024 -0500
Fix ticket/attachment links on SelfService transaction display page
Previously these links were privileged ones that unprivileged users couldn't
access.
diff --git a/share/html/SelfService/Transaction/Display.html b/share/html/SelfService/Transaction/Display.html
index ee47ebf743..ccfa255f5f 100644
--- a/share/html/SelfService/Transaction/Display.html
+++ b/share/html/SelfService/Transaction/Display.html
@@ -45,4 +45,12 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<& /Transaction/Display.html, %ARGS &>
+<& /Transaction/Display.html,
+ DisplayPath => RT->Config->Get('WebPath') . '/SelfService/Display.html',
+ AttachmentPath => RT->Config->Get('WebPath') . '/SelfService/Attachment',
+ UpdatePath => RT->Config->Get('WebPath') . '/SelfService/Update.html',
+ ForwardPath => undef,
+ EmailRecordPath => undef,
+ EncryptionPath => undef,
+ %ARGS,
+&>
diff --git a/t/web/self_service.t b/t/web/self_service.t
index 8e41d327b3..859e8213a3 100644
--- a/t/web/self_service.t
+++ b/t/web/self_service.t
@@ -51,6 +51,33 @@ $m->follow_link_ok(
$m->content_contains( "<h1>$title</h1>", "contains <h1>$title</h1>" );
$m->content_lacks( "There are unread messages on this ticket." );
+$m->follow_link_ok( { url_regex => qr{^/SelfService/Transaction/Display.html}, n => 2 }, 'Followed transaction link' );
+
+$m->text_contains('sample correspondence');
+
+ok( !$m->find_link( url_regex => qr{^/Ticket/} ), 'No privileged ticket links found' );
+ok( !$m->find_link( url_regex => qr{^Update.html} ), 'No self service update links found' );
+
+
+$m->follow_link_ok( { url_regex => qr{^/SelfService/Attachment/}, }, 'Followed self service attachment link' );
+$m->text_contains('sample correspondence');
+$m->back;
+
+RT::Test->add_rights( { Principal => $Cc, Right => ['ReplyToTicket'] } );
+$m->reload;
+$m->follow_link_ok( { url_regex => qr{^/SelfService/Update.html}, }, 'Followed self service ticket link' );
+$m->submit_form_ok(
+ {
+ form_name => 'TicketUpdate',
+ with_fields => { UpdateContent => 'Test correspondence from self service' },
+ button => 'SubmitTicket',
+ },
+ 'Submitted self service update form'
+);
+$m->text_contains('Correspondence added');
+$m->text_contains('Test correspondence from self service');
+
+
diag 'Test $SelfServiceUserPrefs config';
{
# Verify the $SelfServiceUserPrefs config option renders the correct display at
-----------------------------------------------------------------------
hooks/post-receive
--
rt
More information about the rt-commit
mailing list