allow specific user to access specific pages in custom module 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?
I did that through routing.yml file. Thanks for the comments. I posted this just for reference that may help someone else. 

notices.notices_form:
  path: '/notices/addupdate'
  defaults:
    _form: '\Drupal\notices\Form\NoticesAddUpdateForm'
    _title: 'Notices Form'
  requirements:
    _role: 'administrator'

notices.notices_search_form:
  path: '/notices/search'
  defaults:
    _form: '\Drupal\notices\Form\NoticesSearchForm'
    _title: 'Search Notices'
  requirements:
    _access: 'TRUE'