Problem/Motivation
The entity.oembed_provider.add_form 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 oEmbed providers.
Proposed resolution
Replace the _permission requirement with _entity_create_access.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork oembed_providers-3584283
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
chris burge commented@prudloff - Can you try MR29?
Comment #5
prudloff commentedThe MR adds an access control handler but does not use it in oembed_providers.routing.yml.
I think it should be something like this (untested):
Comment #6
chris burge commentedMR is updated
Comment #7
chris burge commentedManual testing is successful:
hook_entity_create_access()andhook_entity_access()are now able to alter entity access. Test coverage includes permissions, and tests pass.Comment #9
chris burge commented