I have added private message module for one of my project which has it's own entity. I need to check whether the user is having access to that entity content or not. The module has it's menu item defined in the module's routing.yml
e.g.:
entity.private_message_thread.canonical:
path: '/private_messages/{private_message_thread}'
defaults:
_entity_view: 'private_message_thread'
_title: 'Private Messages'
requirements:
_entity_access: 'private_message_thread.view'
How could I check whether the user has view access to the above menu path?