diff options
author | Struan Donald <struan@exo.org.uk> | 2019-11-25 16:52:08 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2019-11-26 14:22:17 +0000 |
commit | b36f62bdaf4ca3775c2d6efc4974f98dbd105850 (patch) | |
tree | 36f8eb1545321506b408397244bc471b1fb038f4 /perllib/FixMyStreet/App/Controller/Around.pm | |
parent | bb09cc085962d632d4155c648b2cead7d7b1d717 (diff) |
add bodies_id to stash for around and report/new
This resolved the problem of checking user body permissions on both
around and report/new by adding a variable to stash specifically for
this purpose. Previously staff users could not see the mark private tick
if the report form was loaded via javascript from the around page as
there was no bodies variable in the stash.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Around.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index 377449719..49ff13999 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -235,6 +235,7 @@ sub check_and_stash_category : Private { my $csv = Text::CSV->new(); $csv->combine(@list_of_names); $c->stash->{around_bodies} = \@bodies; + $c->stash->{bodies_ids} = [ map { $_->id } @bodies]; $c->{stash}->{list_of_names_as_string} = $csv->string; my $where = { body_id => [ keys %bodies ], }; |