if( loggedIn() ){ if( userIsAllowed() ){ sendPdfFileWithResumingAndAllThat(); } else { errorNotAllowed(); } } else { errorNotLoggedIn(); }