Skip to content

Commit

Permalink
Fix reference issue in can_moderate.
Browse files Browse the repository at this point in the history
Arguments in TT functions are passed as a hashref.
  • Loading branch information
dracos committed Sep 6, 2018
1 parent abcb1f8 commit 4bd649c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions perllib/FixMyStreet/DB/Result/User.pm
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ sub split_name {
}

sub can_moderate {
my ($self, $object, %perms) = @_;
my ($self, $object, $perms) = @_;

my ($type, $ids);
if ($object->isa("FixMyStreet::DB::Result::Comment")) {
Expand All @@ -342,7 +342,7 @@ sub can_moderate {
$ids = $object->bodies_str_ids;
}

my $staff_perm = exists($perms{staff}) ? $perms{staff} : $self->has_permission_to(moderate => $ids);
my $staff_perm = exists($perms->{staff}) ? $perms->{staff} : $self->has_permission_to(moderate => $ids);
return 1 if $staff_perm;

# See if the cobrand wants to allow it in some circumstance
Expand Down

0 comments on commit 4bd649c

Please sign in to comment.