Add an AccessibleInterface without $operation parameter

Created on 16 October 2013, over 11 years ago
Updated 3 March 2025, 2 months ago

#1951386: Extend BlockPluginInterface::access to allow passing in an account β†’ extends the BlockPluginInterface::access() method with an AccountInterface $account parameter, similar to what AccessibleInterface::access() has.

However, I believe @EclipseGc mentioned the addition of an access check condition to core, and I have one or two cases in a contrib module that will need an access() method without operation as well.

Proposal

Add an interface that defines public function access(AccountInterface $account) for consistency. In the long run, it will save us from having to define it in multiple interfaces. It will also ensure consistency between classes that check access. Classes or interfaces currently in core that would benefit from this:

  • \Drupal\views\Plugin\views\HandlerBase
  • \Drupal\views\Plugin\views\argument_default\ArgumentDefaultPluginBase
  • \Drupal\views\Plugin\views\argument_validator\ArgumentValidatorPluginBase
  • \Drupal\block\BlockPluginInterface

Also read @sdboyer's comment on the BlockPluginInterface for why adding an AccountInterface parameter is a good idea.

If we really want to do the naming well, we can rename the existing AccessibleInterface to AccessibleOperationInterface and name the newly added interface AccessibleInterface.

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

base system

Created by

πŸ‡¬πŸ‡§United Kingdom Xano Southampton

Live updates comments and jobs are added and updated live.
  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

Production build 0.71.5 2024