aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/Cobrand/TfL.pm7
-rw-r--r--perllib/FixMyStreet/Cobrand/UKCouncils.pm2
2 files changed, 9 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/TfL.pm b/perllib/FixMyStreet/Cobrand/TfL.pm
index d6399b5e6..af1df08f2 100644
--- a/perllib/FixMyStreet/Cobrand/TfL.pm
+++ b/perllib/FixMyStreet/Cobrand/TfL.pm
@@ -87,4 +87,11 @@ sub pin_colour {
return 'orange'; # all the other `open_states` like "in progress"
}
+sub admin_allow_user {
+ my ( $self, $user ) = @_;
+ return 1 if $user->is_superuser;
+ return undef unless defined $user->from_body;
+ return $user->from_body->name eq 'TfL';
+}
+
1;
diff --git a/perllib/FixMyStreet/Cobrand/UKCouncils.pm b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
index c652e44c2..3a831b431 100644
--- a/perllib/FixMyStreet/Cobrand/UKCouncils.pm
+++ b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
@@ -241,6 +241,8 @@ sub admin_allow_user {
my ( $self, $user ) = @_;
return 1 if $user->is_superuser;
return undef unless defined $user->from_body;
+ # Make sure TfL staff can't access other London cobrand admins
+ return undef if $user->from_body->name eq 'TfL';
return $user->from_body->areas->{$self->council_area_id};
}