I have created a custom module with custom database table in drupal 8 site. It has add, update, list and search pages.
I want to restrict as only admin or sub-admin can access the add, edit, list pages. Any user(non-registered also) can access the search page.
How to achieve this in the module i have developed itself in drupal 8? Or is there any common way in drupal 8 to add permission for a particular URL?