Commit 43e4b070 authored by catch's avatar catch
Browse files

Issue #3344789 by acbramley, Berdir, fenstrat, benjifisher, borisson_: Return...

Issue #3344789 by acbramley, Berdir, fenstrat, benjifisher, borisson_: Return early in EntityPermissionsForm::access if the user does not have "administer permissions"

(cherry picked from commit cb6824ae)
parent 1080254c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -153,6 +153,10 @@ public function buildForm(array $form, FormStateInterface $form_state, string $b
   *   The access result.
   */
  public function access(Route $route, RouteMatchInterface $route_match, $bundle = NULL): AccessResultInterface {
    $permission = $route->getRequirement('_permission');
    if ($permission && !$this->currentUser()->hasPermission($permission)) {
      return AccessResult::neutral()->cachePerPermissions();
    }
    // Set $this->bundle for use by ::permissionsByProvider().
    if ($bundle instanceof EntityInterface) {
      $this->bundle = $bundle;