diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-12-13 16:41:44 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-12-13 16:51:15 +0000 |
commit | 5f579853c13959d314b2155703fd03642be03443 (patch) | |
tree | 3b2a5751fc74ebbf170ba564d9ab4d9e7d476aed /perllib/FixMyStreet/DB/Result/User.pm | |
parent | 68ed4f77d2e7561351ded8113dffc27a6ce94800 (diff) |
Fail in has_permission_to if given an empty arrayref.
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/User.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/User.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm index 028394795..f4e5144f8 100644 --- a/perllib/FixMyStreet/DB/Result/User.pm +++ b/perllib/FixMyStreet/DB/Result/User.pm @@ -268,7 +268,7 @@ sub has_permission_to { my ($self, $permission_type, $body_ids) = @_; return 1 if $self->is_superuser; - return 0 unless $body_ids; + return 0 if !$body_ids || (ref $body_ids && !@$body_ids); my $permission = $self->user_body_permissions->find({ permission_type => $permission_type, |