aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Admin.pm
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2016-09-16 09:31:38 +0100
committerDave Arter <davea@mysociety.org>2016-09-16 09:39:15 +0100
commite8fb7318f94f78f768700f72b2bb8e3434f108a2 (patch)
tree4aaaf5a942d82c0a17366a9bb89ed072a4723b45 /perllib/FixMyStreet/App/Controller/Admin.pm
parentf2da71c3116f81c386aad164176108d341ac5ecc (diff)
[Zurich] Restore admin user edit functionality
- Zurich users don't need permission to access user_edit page - from_body can be set to any body by Zurich admin users, not just their own - Don't show the area field on user_edit form
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Admin.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index b643c9633..a312a4399 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -1218,7 +1218,7 @@ sub user_edit : Path('user_edit') : Args(1) {
my $user = $c->cobrand->users->find( { id => $id } );
$c->detach( '/page_error_404_not_found', [] ) unless $user;
- unless ( $c->user->is_superuser || $c->user->has_body_permission_to('user_edit') ) {
+ unless ( $c->user->is_superuser || $c->user->has_body_permission_to('user_edit') || $c->cobrand->moniker eq 'zurich' ) {
$c->detach('/page_error_403_access_denied', []);
}
@@ -1253,7 +1253,7 @@ sub user_edit : Path('user_edit') : Args(1) {
$user->is_superuser( ( $c->user->is_superuser && $c->get_param('is_superuser') ) || 0 );
# Superusers can set from_body to any value, but other staff can only
# set from_body to the same value as their own from_body.
- if ( $c->user->is_superuser ) {
+ if ( $c->user->is_superuser || $c->cobrand->moniker eq 'zurich' ) {
$user->from_body( $c->get_param('body') || undef );
} elsif ( $c->user->has_body_permission_to('user_assign_body') &&
$c->get_param('body') && $c->get_param('body') eq $c->user->from_body->id ) {