The attached patch contains a new access plugin for possible inclusion in CTools. This access plugin allows a user to use the access on another Drupal path.
For example, if making a custom search page in Page Manager, it's useful to be able to use the same access defined on the default search path, rather than remaking a combination of permissions & other access checks. Using this plugin, it's easy.

The plugin can potentially be used to 'chain' together path access checks. If it is checking the access of another page that refers back to the original page (directly or not), it tries to be 'invisible' by using the other plugins set on the page to define the access. (This avoids circular loops in checking the access of other paths.)

I have created a CTools Path Access plugin project that contains the plugin, but if the plugin is considered useful enough for inclusion in CTools itself, I will happily remove that project. It's just somewhere for this to live other than the black hole of the issue queue!

I attach a patch that was built in the standard way, but also one that used --no-prefix so that it's compatible with Drush make :-)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

Status: Needs review » Closed (won't fix)

This is interesting. However, I think for the moment we'll let you keep it in that project. If it gets popular, we'll revisit it for CTools, but I suspect it's a fairly narrow use case and it'll get better maintenance if someone else is looking after it.

Thank you for the submission, however!

james.williams’s picture

Cool, thanks for taking a look! :-)