Skip to content

Commit

Permalink
DP-196 Fix hasRole method
Browse files Browse the repository at this point in the history
  • Loading branch information
yaroslavmo committed Apr 20, 2020
1 parent f48e58f commit d1f7cea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Utility/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -1086,10 +1086,14 @@ public static function forget($key)
}

/**
* @return mixed
* @return boolean
*/
private static function hasRole()
{
return UserAppRole::whereUserId(Session::getCurrentUserId())->exists();
if(is_null(\Session::get('has_role'))){
\Session::put('has_role', UserAppRole::whereUserId(Session::getCurrentUserId())->exists());
}

return \Session::get('has_role');
}
}

0 comments on commit d1f7cea

Please sign in to comment.