Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mxr576 created an issue. See original summary.

Dave Reid’s picture

I have a feeling that this code is no longer used at all. I'll deprecate those two functions.

Dave Reid’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: 3156088-deprecate-link-bundle-access-bundle-path.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Dave Reid’s picture

Status: Needs work » Needs review
FileSize
6.4 KB

Sigh, $entity is not an actual entity, but an entity type.

  • Dave Reid committed db623fd on 8.x-1.x
    Issue #3156088 by Dave Reid: Deprecated xmlsitemap_link_bundle_access()...
Dave Reid’s picture

Status: Needs review » Fixed

Committed #5 to 8.x-1.x.

  • Dave Reid committed db623fd on 2.x
    Issue #3156088 by Dave Reid: Deprecated xmlsitemap_link_bundle_access()...
mxr576’s picture

Thanks for the quick fix.

mxr576’s picture

Status: Fixed » Needs work
FileSize
112.59 KB

So 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 administer create/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.

Dave Reid’s picture

I'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.

mxr576’s picture

I 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.