aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/Update.pm2
-rw-r--r--templates/web/base/report/update/form_update.html4
-rw-r--r--templates/web/bromley/report/update/form_update.html5
4 files changed, 6 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fccdbfcca..67fe1b3be 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@
- Bugfixes:
- Add perl 5.26/5.28 support.
- Fix subcategory issues when visiting /report/new directly #2276
+ - Give superusers access to update staff dropdowns. #2286
- Development improvements:
- Add cobrand hook for dashboard viewing permission. #2285
- Have body.url work in hashref lookup. #2284
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm
index 5ad21ba48..cb9bbdb67 100644
--- a/perllib/FixMyStreet/App/Controller/Report/Update.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm
@@ -343,7 +343,7 @@ sub check_for_errors : Private {
my $state = $c->get_param('state');
if ( $state && $state ne $c->stash->{update}->problem->state ) {
my $error = 0;
- $error = 1 unless $c->user && $c->user->belongs_to_body( $c->stash->{update}->problem->bodies_str );
+ $error = 1 unless $c->user && ($c->user->is_superuser || $c->user->belongs_to_body($c->stash->{update}->problem->bodies_str));
$error = 1 unless grep { $state eq $_ } FixMyStreet::DB::Result::Problem->visible_states();
if ( $error ) {
$c->stash->{errors} ||= [];
diff --git a/templates/web/base/report/update/form_update.html b/templates/web/base/report/update/form_update.html
index ed5b83355..fb79232a2 100644
--- a/templates/web/base/report/update/form_update.html
+++ b/templates/web/base/report/update/form_update.html
@@ -27,7 +27,7 @@
[% END %]
<label for="form_update">[% loc( 'Update' ) %]</label>
-[% IF c.user && c.user.belongs_to_body( problem.bodies_str ) %]
+[% IF c.user AND (c.user.is_superuser OR c.user.belongs_to_body(problem.bodies_str)) %]
[% INCLUDE 'admin/response_templates_select.html' for='form_update' %]
[% END %]
[% IF field_errors.update %]
@@ -35,7 +35,7 @@
[% END %]
<textarea rows="7" cols="30" name="update" class="form-control" id="form_update" required>[% update.text | html %]</textarea>
-[% IF c.user && c.user.belongs_to_body( problem.bodies_str ) %]
+[% IF c.user AND (c.user.is_superuser OR c.user.belongs_to_body(problem.bodies_str)) %]
<label for="state">[% loc( 'State' ) %]</label>
[% INCLUDE 'report/inspect/state_groups_select.html' %]
[% ELSE %]
diff --git a/templates/web/bromley/report/update/form_update.html b/templates/web/bromley/report/update/form_update.html
index 190993a0f..01e069dfc 100644
--- a/templates/web/bromley/report/update/form_update.html
+++ b/templates/web/bromley/report/update/form_update.html
@@ -37,7 +37,7 @@
</div>
<label for="form_update">[% loc( 'Update' ) %]</label>
-[% IF c.user && c.user.belongs_to_body( problem.bodies_str ) %]
+[% IF c.user AND (c.user.is_superuser OR c.user.belongs_to_body(problem.bodies_str)) %]
[% INCLUDE 'admin/response_templates_select.html' for='form_update' %]
[% END %]
[% IF field_errors.update %]
@@ -45,10 +45,9 @@
[% END %]
<textarea rows="7" cols="30" name="update" class="form-control" id="form_update" required>[% update.text | html %]</textarea>
-[% IF c.user && c.user.belongs_to_body( problem.bodies_str ) %]
+[% IF c.user AND (c.user.is_superuser OR c.user.belongs_to_body(problem.bodies_str)) %]
<label for="state">[% loc( 'State' ) %]</label>
[% INCLUDE 'report/inspect/state_groups_select.html' %]
[% ELSE %]
[% INCLUDE report/update/form_state_checkbox.html %]
[% END %]
-