Problem/Motivation

\Drupal\user\PermissionHandler::buildPermissionsYaml() Will override the provider for permissions if it has been set by the permission callback.

Proposed resolution

Set the provider only if not already explicitly set.

Remaining tasks

User interface changes

n/a

API changes

Adds the ability to set the provider for a permission.

Data model changes

none

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

Jaesin created an issue. See original summary.

Jaesin’s picture

See here for the use case for this:

It's adds a permission provider handler for custom content entities.

dawehner’s picture

Status: Active » Needs work
Issue tags: +Needs tests

WFM. Nice small fix

We have some nice little unit test coverage already, \Drupal\Tests\user\Unit\PermissionHandlerTest should be easy.

Jaesin’s picture

Status: Needs work » Needs review
FileSize
3.65 KB
2.97 KB
4 KB

This allows yaml provided permissions to proxy permissions for other modules as well.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests +Contributed project blocker

Nice one!

The last submitted patch, 4: 2673726.4-test-only.patch, failed testing.

dawehner’s picture

Issue summary: View changes
catch’s picture

Title: Allow modules to proxy permisisons for other modules. » Allow modules to proxy permissions for other modules.
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.2.x and cherry-picked to 8.1.x. Thanks!

  • catch committed 99151ae on 8.2.x
    Issue #2673726 by Jaesin, dawehner: Allow modules to proxy permissions...

  • catch committed b5f95d8 on 8.1.x
    Issue #2673726 by Jaesin, dawehner: Allow modules to proxy permissions...
jibran’s picture

Can we have a change notice for this? I don't understand this change.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.