Skip to content

Commit

Permalink
[Gloucestershire] Request for user to not be able to reopen reports
Browse files Browse the repository at this point in the history
  • Loading branch information
MorayMySoc committed Nov 17, 2023
1 parent 4aff6ed commit 029f38d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions perllib/FixMyStreet/Cobrand/FixMyStreet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ sub reopening_disallowed {
return 1 if $problem->to_body_named("Southwark") && $c->user_exists && (!$c->user->from_body || $c->user->from_body->name ne "Southwark Council");
return 1 if $problem->to_body_named("Merton") && $c->user_exists && (!$c->user->from_body || $c->user->from_body->name ne "Merton Council");
return 1 if $problem->to_body_named("Northumberland") && $c->user_exists && (!$c->user->from_body || $c->user->from_body->name ne "Northumberland County Council");
return 1 if $problem->to_body_named("Gloucestershire") && $c->user_exists && (!$c->user->from_body || $c->user->from_body->name ne "Gloucestershire County Council");
return $self->next::method($problem);
}

Expand Down
14 changes: 14 additions & 0 deletions perllib/FixMyStreet/Cobrand/Gloucestershire.pm
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ sub privacy_policy_url {
'https://www.gloucestershire.gov.uk/council-and-democracy/data-protection/privacy-notices/gloucestershire-county-council-general-privacy-statement/gloucestershire-county-council-general-privacy-statement/'
}

=item * Users can not reopen reports
=cut

sub reopening_disallowed {
my ($self, $problem) = @_;

# Only staff can reopen reports.
my $c = $self->{c};
my $user = $c->user;
return 0 if ($c->user_exists && $user->from_body && $user->from_body->cobrand_name eq $self->council_name);
return 1;
}

=item * We do not send questionnaires.
=cut
Expand Down
5 changes: 3 additions & 2 deletions t/cobrand/gloucestershire.t
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,14 @@ FixMyStreet::override_config {
note 'Original reporter';
$mech->log_in_ok( $standard_user_1->email );
$mech->get( '/report/' . $report->id );

$mech->content_contains(
'name="update" class="form-control" id="form_update"',
'Update textbox shown',
);
$mech->content_contains(
$mech->content_lacks(
'type="checkbox" name="reopen" id="form_reopen"',
'State checkbox shown',
'State checkbox not shown',
);
$mech->content_lacks(
'select class="form-control" name="state" id="state"',
Expand Down

0 comments on commit 029f38d

Please sign in to comment.