public static function checkAuthorPermission() { if (Session::isLoggedInUser() && "AUTHOR" === Session::getLoggedInUser()) { // You are allowed to perform operation return true; } else { return Session::throwHimOut(); } }