From 004a13a5f7cca59fb496f500a299bf26661fd00d Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Mon, 13 Sep 2021 00:58:39 -0600 Subject: [PATCH] fix null admin role breaking user transformer --- app/Transformers/Api/Application/UserTransformer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Transformers/Api/Application/UserTransformer.php b/app/Transformers/Api/Application/UserTransformer.php index d0439e654..dcf3db55d 100644 --- a/app/Transformers/Api/Application/UserTransformer.php +++ b/app/Transformers/Api/Application/UserTransformer.php @@ -46,7 +46,7 @@ class UserTransformer extends Transformer */ public function includeRole(User $user) { - if (!$this->authorize(AdminAcl::RESOURCE_ROLES)) { + if (!$this->authorize(AdminAcl::RESOURCE_ROLES) || is_null($user->adminRole)) { return $this->null(); }