Put this method in AppController
class AppController extends Controller
{
function levelCheck(){
# whatever
}
}
This is the correct place of this action. Because AppController is extended in all the controller so this method can called using current controller object that is $this->levelCheck().