public static function checkUserPermission() { $user = Session::getLoggedInUser(); if (Session::isUser()) { // You are allowed to perform operation return true; } else { return Session::throwHimOut(); } }