diff options
author | Marius Halden <marius.h@lden.org> | 2016-12-16 15:02:53 +0100 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2016-12-16 15:02:53 +0100 |
commit | dbf56159e44c1560a413022451bf1a1c4cb22a52 (patch) | |
tree | 275599a1894ca48d8dbf3c2843064c3dbf4affc7 /perllib/FixMyStreet/Cobrand | |
parent | a1603b96cae9258761f8cc59d76e0512f49afc3d (diff) | |
parent | 38490f6ea18064c232bda6ebfbaee052bd8f0951 (diff) |
Merge tag 'v2.0.1' into fiksgatami-dev-v2
Diffstat (limited to 'perllib/FixMyStreet/Cobrand')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Oxfordshire.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/UKCouncils.pm | 15 |
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 { |