Updated: Comment 0

Problem/Motivation

Currently it is really exhausting to register a access checker as you have to create a service and specify the right tab.

Let's drop the need to specify a tag.

Before

  views.route_access_check:
    class: Drupal\views\ViewsAccessCheck
    tags:
      - { name: 'access_check' }

After

  views.route_access_check:
    class: Drupal\views\ViewsAccessCheck

Proposed resolution

Remaining tasks

User interface changes

API changes

Files: 
CommentFileSizeAuthor
#8 access-2100131-8.patch11.3 KBpwolanin
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.
[ View ]
#8 2100131-5-8.increment.txt1.11 KBpwolanin
#5 access-2100131-3.patch11.06 KBdawehner
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.
[ View ]
#3 access-2100131-2.patch11.02 KBdawehner
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.
[ View ]
#1 access-2048223-70.patch79.63 KBdawehner
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch access-2048223-70.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

dawehner’s picture

Status:Active» Needs review
Issue tags:+DX (Developer Experience)
StatusFileSize
new79.63 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch access-2048223-70.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Here is a simple try.

Status:Needs review» Needs work

The last submitted patch, access-2048223-70.patch, failed testing.

dawehner’s picture

Status:Needs work» Needs review
StatusFileSize
new11.02 KB
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.
[ View ]

This was the wrong patch.

Status:Needs review» Needs work

The last submitted patch, access-2100131-2.patch, failed testing.

dawehner’s picture

Status:Needs work» Needs review
StatusFileSize
new11.06 KB
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.
[ View ]

This was also wrong.

Status:Needs review» Needs work

The last submitted patch, access-2100131-3.patch, failed testing.

dawehner’s picture

For some odd reasons the class are boolean at some point etc,

WD php: Warning: class_implements(): Class Drupal\user\TempStoreFactory does not exist and could not be loaded in Drupal\Core\DependencyInjection\Compiler\RegisterAccessChecksPass->process() (line 29 of                                                             [warning]
/var/www/d8/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterAccessChecksPass.php).
WD php: Warning: class_implements(): Class Drupal\system\Plugin\ImageToolkitManager does not exist and could not be loaded in Drupal\Core\DependencyInjection\Compiler\RegisterAccessChecksPass->process() (line 29 of                                                 [warning]
/var/www/d8/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterAccessChecksPass.php).
WD php: Warning: class_implements(): Class Drupal\system\Plugin\ImageToolkitInterface does not exist and could not be loaded in Drupal\Core\DependencyInjection\Compiler\RegisterAccessChecksPass->process() (line 29 of                                               [warning]
/var/www/d8/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterAccessChecksPass.php).
WD php: Warning: class_implements(): Class Drupal\user\TempStoreFactory does not exist and could not be loaded in Drupal\Core\DependencyInjection\Compiler\RegisterAccessChecksPass->process() (line 29 of                                                             [warning]
/var/www/d8/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterAccessChecksPass.php).
WD php: Warning: class_implements(): Class Drupal\system\Plugin\ImageToolkitManager does not exist and could not be loaded in Drupal\Core\DependencyInjection\Compiler\RegisterAccessChecksPass->process() (line 29 of                                                 [warning]
/var/www/d8/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterAccessChecksPass.php).
WD php: Warning: class_implements(): Class Drupal\system\Plugin\ImageToolkitInterface does not exist and could not be loaded in Drupal\Core\DependencyInjection\Compiler\RegisterAccessChecksPass->process() (line 29 of                                               [warning]
/var/www/d8/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterAccessChecksPass.php).
WD php: ReflectionException: Class Drupal\user\TempStoreFactory does not exist in ReflectionClass->__construct() (line 961 of /var/www/d8/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php).                        [error]
ReflectionException: Class Drupal\user\TempStoreFactory does not exist in ReflectionClass->__construct() (line 961 of /var/www/d8/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php).
Drush command terminated abnormally due to an unrecoverable error.   
pwolanin’s picture

Status:Needs work» Needs review
StatusFileSize
new1.11 KB
new11.3 KB
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.
[ View ]

I think it might work using is_subclass_of()

Status:Needs review» Needs work

The last submitted patch, access-2100131-8.patch, failed testing.

dawehner’s picture

dawehner’s picture

Issue summary:View changes
Status:Needs work» Closed (won't fix)

... We don't do something similar somewhere else, so I don't think its worth to do. Maybe in 8.1.x we could introduce a general patterns
for all interface based services.

Note: Access checkers would need a specific tag anyway now, see the following example:

    tags:
  access_check.user.role:
    class: Drupal\user\Access\RoleAccessCheck
      - { name: access_check, applies_to: _role }