How to use the YML structure of routes to control access to Group Content I am using the Group module and would like to leverage each Group's permissions in my module's yml files. 

I have a module.permissions.yml with something like 

tam_api.group_gid_members_uid:
  path: 'group/{group}/members/{member}'
  defaults: { _controller: '\Drupal\tam_api\Controller\TamApi::getGroupMember' }
  methods: [GET, HEAD]
  requirements:
    _permission: 'access user profiles'
  options:
    _format : ['json']
    _auth: ['oauth2', 'cookie']
    parameters:
      group:
        type: entity:group
      member:
        type: entity:group_content


I would like to change access user profiles to the View individual group members for the given Group?

Can this be done within the Structure of Routes?
in group.services.yml you'll find access_check entries like:

  access_check.group.permission:
    class: 'Drupal\group\Access\GroupPermissionAccessCheck'
    tags:
      - { name: 'access_check', applies_to: '_group_permission' }
  access_check.group.member:
    class: 'Drupal\group\Access\GroupMemberAccessCheck'
    tags:
      - { name: 'access_check', applies_to: '_group_member' }


you can use these in your routes like:

tam_api.group_gid_members_uid:
  path: 'group/{group}/members/{member}'
  defaults: { _controller: '\Drupal\tam_api\Controller\TamApi::getGroupMember' }
  methods: [GET, HEAD]
  requirements:
    _group_member: 'TRUE'
# or    _group_permission: 'view group membership content'
  options:
    _format : ['json']
    _auth: ['oauth2']
    parameters:
      group:
        type: entity:group
      member:
        type: entity:group_content


Note: the parameter argument must be named {group}