How do I add role permissions to custom module I have a custom module in Drupal 8 and I have created a role called editor.
How do use .permissions.yml in my module to get it to display on the editor's role?
Create a file my_module.permissions.yml and add

my permission:
  title: 'This is my custom permission'
  description: 'A custom permission for your.'


Then use your permission in your my_module.routing.yml:

example.name:
  path: '/example/{name}'
  defaults:
    _controller: '\Drupal\example\Controller\ExampleController::content'
  requirements:
    _permission: 'my permission'


Now you can configure your custom permission on admin/people/permissions