summaryrefslogtreecommitdiff
path: root/app/Model/User.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Model/User.php')
-rw-r--r--app/Model/User.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/Model/User.php b/app/Model/User.php
index 78d44b47..29def6d4 100644
--- a/app/Model/User.php
+++ b/app/Model/User.php
@@ -48,7 +48,8 @@ class User extends Base
*/
public function isAdmin($user_id)
{
- return $this->db
+ return $this->userSession->isAdmin() || // Avoid SQL query if connected
+ $this->db
->table(User::TABLE)
->eq('id', $user_id)
->eq('is_admin', 1)