'Edit Own Content' permission missing in custom entity I have generated a custom entity using Drupal Console.

drupal generate:entity:content


The entity doesn't have the permission edit own content which we usually have in node types etc... The entities entity_name.permissions.yml the file has the following enteries. 

add company entities:
  title: 'Create new Company entities'

administer company entities:
  title: 'Administer Company entities'
  description: 'Allow to access the administration form to configure Company entities.'
  restrict access: true

delete company entities:
  title: 'Delete Company entities'

edit company entities:
  title: 'Edit Company entities'

access company overview:
  title: 'Access the Company overview page'

view published company entities:
  title: 'View published Company entities'

view unpublished company entities:
  title: 'View unpublished Company entities'


I tried understanding, how this is done in node. But in node types permission file also I couldn't find this permission entered.
If you look at the end of the node permissions file, you'll see:

permission_callbacks:
  - \Drupal\node\NodePermissions::nodeTypePermissions


If you look at the buildPermissions method, you'll see where the rest of the node permissions are created.  

And then in node.module, take a look at node_node_access implementation of hook_node_access. 

Also, see: \Drupal\node\NodeAccessControlHandler and the corresponding Interface class. It seems fairly complex, but both the node_node_access method and the NodeAccessControlHandlerInterface are well-documented and seem like a good place to start for developing your custom entity permissions system.