diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-10-31 15:38:50 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-10-31 15:38:50 +0000 |
commit | f93bc85184077506c555e444c55abbeb1976f03e (patch) | |
tree | be532d1919f1d0044a15caef8ffce2a3475609db /perllib/FixMyStreet/DB/Result/User.pm | |
parent | c76880f3ce225df63cb8f712982177b8ca5b2d0e (diff) | |
parent | 3d593bc68d65015a50f8f4b1a6d9f818d8678226 (diff) |
Merge branch '2fa-improvements'
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/User.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/User.pm | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm index 85fdc790b..805ea4776 100644 --- a/perllib/FixMyStreet/DB/Result/User.pm +++ b/perllib/FixMyStreet/DB/Result/User.pm @@ -438,9 +438,6 @@ sub has_permission_to { my $cobrand = $self->result_source->schema->cobrand; my $cobrand_perms = $cobrand->available_permissions; my %available = map { %$_ } values %$cobrand_perms; - # The 'trusted' permission is never set in the cobrand's - # available_permissions (see note there in Default.pm) so include it here. - $available{trusted} = 1; return 0 unless $available{$permission_type}; return 1 if $self->is_superuser; @@ -498,7 +495,7 @@ sub admin_user_body_permissions { sub has_2fa { my $self = shift; - return $self->is_superuser && $self->get_extra_metadata('2fa_secret'); + return $self->get_extra_metadata('2fa_secret'); } sub contributing_as { @@ -600,14 +597,6 @@ sub is_planned_report { return scalar grep { $_->report_id == $id } @{$self->active_user_planned_reports}; } -sub update_reputation { - my ( $self, $change ) = @_; - - my $reputation = $self->get_extra_metadata('reputation') || 0; - $self->set_extra_metadata( reputation => $reputation + $change); - $self->update; -} - has categories => ( is => 'ro', lazy => 1, |