aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/Cobrand')
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm1
-rw-r--r--perllib/FixMyStreet/Cobrand/Oxfordshire.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/UKCouncils.pm15
3 files changed, 14 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index a2ca9f8c1..27111deb2 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -1184,6 +1184,7 @@ Return true if an Open311 service attribute should be a hidden field.
sub category_extra_hidden {
my ($self, $meta) = @_;
+ return 0;
}
1;
diff --git a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
index a476b5e9b..dca208e98 100644
--- a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
+++ b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
@@ -119,4 +119,6 @@ sub contact_email {
return join( '@', 'highway.enquiries', 'oxfordshire.gov.uk' );
}
+sub admin_user_domain { 'oxfordshire.gov.uk' }
+
1;
diff --git a/perllib/FixMyStreet/Cobrand/UKCouncils.pm b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
index 42c9c5cbc..c22224307 100644
--- a/perllib/FixMyStreet/Cobrand/UKCouncils.pm
+++ b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
@@ -55,8 +55,9 @@ sub updates_restriction {
sub users_restriction {
my ($self, $rs) = @_;
- # Council admins can only see users who are members of the same council or
- # users who have sent a report or update to that council.
+ # Council admins can only see users who are members of the same council,
+ # have an email address in a specified domain, or users who have sent a
+ # report or update to that council.
my $problem_user_ids = $self->problems->search(
undef,
@@ -73,10 +74,16 @@ sub users_restriction {
}
)->as_query;
- return $rs->search([
+ my $or_query = [
from_body => $self->council_id,
id => [ { -in => $problem_user_ids }, { -in => $update_user_ids } ],
- ]);
+ ];
+ if ($self->can('admin_user_domain')) {
+ my $domain = $self->admin_user_domain;
+ push @$or_query, email => { ilike => "%\@$domain" };
+ }
+
+ return $rs->search($or_query);
}
sub base_url {