From acf4f8e6c99bf0165d1464a98694af7f4e4a570d Mon Sep 17 00:00:00 2001 From: Nicolas Widart Date: Wed, 24 Jun 2015 10:46:35 +0200 Subject: [PATCH] Check if user is logged in before checking role --- Repositories/Sentinel/SentinelAuthentication.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Repositories/Sentinel/SentinelAuthentication.php b/Repositories/Sentinel/SentinelAuthentication.php index f7870dd..cea1fc6 100644 --- a/Repositories/Sentinel/SentinelAuthentication.php +++ b/Repositories/Sentinel/SentinelAuthentication.php @@ -116,6 +116,10 @@ public function completeResetPassword($user, $code, $password) */ public function hasAccess($permission) { + if (! Sentinel::check()) { + return false; + } + return Sentinel::hasAccess($permission); }