Problem/Motivation
In our application, we would like some plugins only available to users with specific roles. For example - EntityInformationPathAlias should be available only to user with `administer url aliases` permission. This is not only limited to permission - some plugins can only be available based on some computations, ex. if entity has a field_foo and field_foo has value bar then plugin should be available, hidden otherwise.
Steps to reproduce
n/a
Proposed resolution
Introduce AccessAwareInterface with an ::access(AccountInterface $account, EntityInterface $entity) method
In EntityInformationController::render() only show plugins that are accessible if they implement AccessAwareInterface
User interface changes
n/a
API changes
Additions only, no change for current users is expected
Data model changes
Additions only, no change for current users is expected
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3371243-2.patch | 3.66 KB | teodorakis |
Comments
Comment #2
teodorakis commentedAdded the patch.
Comment #3
wilfred.waltman commentedThanks. I will take a look at the patch soon.
Comment #4
wilfred.waltman commentedGood suggestion, thanks for the input.