Problem/Motivation
The crop.type_add route requires a permission explicitly.
It is a better practice to use the _entity_create_access requirement, this way access can be altered with hook_entity_create_access.
Steps to reproduce
Add this hook:
/**
* Implements hook_entity_create_access().
*/
function test_entity_create_access() {
return AccessResult::forbidden();
}
You can still create crop types.
Proposed resolution
Replace the _permission requirement with _entity_create_access.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3584276-use-entity-create-access.patch | 407 bytes | dkmishra |
Issue fork crop-3584276
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
dkmishra commentedProposed fix replaces the crop.type_add route permission requirement with _entity_create_access.