- Issue created by @das-peter
- Merge request !23Issue #3484865: MenuExtension not allowing access without management permission → (Open) created by das-peter
- 🇨🇭Switzerland ayalon
We have doumented this under security:
https://graphql-core-schema.netlify.app/basics/security.htmlThere you can also see an example of a custom module. Because we claim to be secure by default, I would like to avoid any code that could possible expose data, that is not accessible via core.
I recommend using the proposed hook:
/** * Implements hook_ENTITY_TYPE_access(). */ function MY_MODULE_menu_access(EntityInterface $entity, $operation, AccountInterface $account) { // Grant view access to the main menu to everyone. $id = $entity->id(); if ($operation === 'view' && $id === 'main') { return AccessResult::allowed(); } return AccessResult::neutral(); }