aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/Result/User.pm
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2021-10-07 13:32:40 +0200
committerMarius Halden <marius.h@lden.org>2021-10-07 13:32:40 +0200
commit09dacfc6b8bf62addeee16c20b1d90c2a256da96 (patch)
tree7caa2bf9e92227ab74448f9b746dd28bbcb81b2a /perllib/FixMyStreet/DB/Result/User.pm
parent585e57484f9c6332668bf1ac0a6a3b39dbe32223 (diff)
parentcea89fb87a96943708a1db0f646492fbfaaf000f (diff)
Merge tag 'v3.1' into fiksgatami-devfiksgatami-dev
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/User.pm')
-rw-r--r--perllib/FixMyStreet/DB/Result/User.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm
index b0a05d0b7..e5be14abf 100644
--- a/perllib/FixMyStreet/DB/Result/User.pm
+++ b/perllib/FixMyStreet/DB/Result/User.pm
@@ -179,6 +179,11 @@ sub check_password {
}
}
+sub access_token {
+ my $self = shift;
+ return $self->get_extra_metadata('access_token');
+}
+
around password => sub {
my ($orig, $self) = (shift, shift);
if (@_) {
@@ -444,7 +449,7 @@ sub permissions {
my $body_id = $problem->bodies_str;
- return unless $self->belongs_to_body($body_id);
+ return {} unless $self->belongs_to_body($body_id);
my @permissions = grep { $_->{body_id} == $self->from_body->id } @{$self->body_permissions};
return { map { $_->{permission} => 1 } @permissions };