diff options
author | Joe Siltberg <git@joesiltberg.se> | 2018-10-31 10:29:40 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-11-05 09:37:23 +0000 |
commit | 3de208b311a1a0a3d02efbb1383b32192282b306 (patch) | |
tree | fc439cddbb3a98259290baf1deed775a5f6a576c /perllib | |
parent | 8d553f850ef1feea93cb271ccdcd58a78710552a (diff) |
Add configuration option to show staff user name as well as body name
This adds a cobrand configuration option for always showing the
body user's name in updates.
Fixes #1860
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Comment.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index d27c5ea8c..738b58f82 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -248,7 +248,9 @@ sub meta_line { $body = "$body <img src='/cobrands/greenwich/favicon.png' alt=''>"; } } - my $can_view_contribute = $c->user_exists && $c->user->has_permission_to('view_body_contribute_details', $self->problem->bodies_str_ids); + my $cobrand_always_view_body_user = $c->cobrand->call_hook("always_view_body_contribute_details"); + my $can_view_contribute = $cobrand_always_view_body_user || + ($c->user_exists && $c->user->has_permission_to('view_body_contribute_details', $self->problem->bodies_str_ids)); if ($self->text) { if ($can_view_contribute) { $meta = sprintf( _( 'Posted by <strong>%s</strong> (%s) at %s' ), $body, $user_name, Utils::prettify_dt( $self->confirmed ) ); |