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

CommentFileSizeAuthor
#2 3371243-2.patch3.66 KBteodorakis

Comments

zaporylie created an issue. See original summary.

teodorakis’s picture

Status: Active » Needs review
StatusFileSize
new3.66 KB

Added the patch.

wilfred.waltman’s picture

Assigned: Unassigned » wilfred.waltman

Thanks. I will take a look at the patch soon.

wilfred.waltman’s picture

Version: 2.0.0 » 2.1.0
Status: Needs review » Fixed

Good suggestion, thanks for the input.

Status: Fixed » Closed (fixed)

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