Modified to add role based menu display and pagination in search.