diff options
author | Dave Arter <davea@mysociety.org> | 2016-08-01 16:36:55 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2016-08-17 15:34:53 +0100 |
commit | 91c5520c7078f2caa3cbdbdcff4f86a29d9d7390 (patch) | |
tree | 3f6919c4a7713db5db4e83aeddec87591742da6f /perllib/FixMyStreet/Cobrand/Default.pm | |
parent | f0220a9742ef0b7458b2dafaba5d9f860a741a91 (diff) |
Restrict user editing in admin
The 'user_edit' permission is required to edit users.
The admin pages on UK council cobrands only allow editing of users whose
from_body is the same as the logged-in user, or who have sent reports or updates
to the council.
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/Default.pm')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index 686684a05..8c75a1234 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -140,6 +140,30 @@ sub problems_on_map_restriction { return $rs; } +=head1 users + +Returns a ResultSet of Users, potentially restricted to a subset if we're on +a cobrand that only wants some of the data. + +=cut + +sub users { + my $self = shift; + return $self->users_restriction($self->{c}->model('DB::User')); +} + +=head1 users_restriction + +Used to restricts users in the admin in a cobrand in a particular way. Do +nothing by default. + +=cut + +sub users_restriction { + my ($self, $rs) = @_; + return $rs; +} + sub site_key { return 0; } =head2 restriction |