diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-04-15 19:12:31 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-05-08 08:35:42 +0100 |
commit | ecc5a7b9ca20418f1bdb45cdc3ce5b41a11f3593 (patch) | |
tree | 32e1397d2f156d735a822775f9880610e7cce34f /perllib/FixMyStreet/App/Controller/Admin/Users.pm | |
parent | 7d395d5ca8049a904473e90957115ce675e57db7 (diff) |
Add assigned_(users|categories)_only functionality
Users with assigned_categories_only will only see staff features on a
report page in their assigned categories.
Users will only see staff features on a report page in a category with
assigned_users_only if it is in their assigned categories.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Admin/Users.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin/Users.pm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/Users.pm b/perllib/FixMyStreet/App/Controller/Admin/Users.pm index 046e19126..f4b9bd7dc 100644 --- a/perllib/FixMyStreet/App/Controller/Admin/Users.pm +++ b/perllib/FixMyStreet/App/Controller/Admin/Users.pm @@ -373,6 +373,11 @@ sub edit : Chained('user') : PathPart('') : Args(0) { my @live_contact_ids = map { $_->id } @live_contacts; my @new_contact_ids = grep { $c->get_param("contacts[$_]") } @live_contact_ids; $user->set_extra_metadata('categories', \@new_contact_ids); + if ($c->get_param('assigned_categories_only')) { + $user->set_extra_metadata(assigned_categories_only => 1); + } else { + $user->unset_extra_metadata('assigned_categories_only'); + } } else { $user->unset_extra_metadata('categories'); } |