\Drupal\consumers\AccessControlHandler:: checkCreateAccess

Created on 29 November 2023, 7 months ago
Updated 30 November 2023, 7 months ago

Problem/Motivation

Access handler's '::checkCreateAccess' does not call parent, which would check for admin permission on consumer create. This way if the user role have administer permission for consumer entities, but no add permission, it is still restricted to create new consumer entity.

Steps to reproduce

Proposed resolution

protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
    $access = parent::checkCreateAccess($account, $context, $entity_bundle);

    return $access->orIf(AccessResult::allowedIfHasPermission(
      $account,
      sprintf('add %s entities', static::$name),
    ));
  }

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ญ๐Ÿ‡บHungary attilatilman

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024