Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Comment | File | Size | Author |
---|---|---|---|
#10 | screeshot-2020-07-02-10-36-34.png | 112.59 KB | mxr576 |
#5 | 3156088-deprecate-link-bundle-access-bundle-path.patch | 6.4 KB | Dave Reid |
| |||
#2 | 3156088-deprecate-link-bundle-access-bundle-path.patch | 6.1 KB | Dave Reid |
Comments
Comment #2
Dave ReidI have a feeling that this code is no longer used at all. I'll deprecate those two functions.
Comment #3
Dave ReidComment #5
Dave ReidSigh, $entity is not an actual entity, but an entity type.
Comment #7
Dave ReidCommitted #5 to 8.x-1.x.
Comment #9
mxr576Thanks for the quick fix.
Comment #10
mxr576So I had no issue with the xmlsitemap_link_bundle_access() hook, it should have just done a better callback handling, like allowing classes methods/services/functions to be passed a callback by using
\Drupal\Core\DependencyInjection\ClassResolverInterface::getInstanceFromDefinition()
Now that the function is deprecated my old code should be useless that granted access to a user who has
administercreate/edit XY node bundle permission, BUT the committed code does not handle node bundles, the node entity itself does not have admin permission, bundles have.Comment #11
Dave ReidI'd rather add a separate "can override xmlsitemap settings on items" permission, rather than adding this back in. There might be an existing issue for this? You could also form alter that #access property to TRUE with your specific logic.
Comment #12
mxr576I do not want to alter form just to make this very simple feature be implemented. I rather like to concept of adding an "access checker services" that could decide if in the given context a user can add/chance XMLsitemap settings or not on an enitty. That service could be easily decorated by downstream devs to extend the implementation.
Granular permissions are always better and if it out of the scope of XMLSitemap to provide those granular permissions to every entity (including nodes) - I do believe it is out scope - then it should provide a simple way of extending the implementations.