Commit 121576de authored by Sascha Grossenbacher's avatar Sascha Grossenbacher
Browse files

Issue #3307481 by Berdir: Change library item canonical access to use the...

Issue #3307481 by Berdir: Change library item canonical access to use the update entity access operation instead of hardcoded permissions
parent a73a12a2
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -19,10 +19,8 @@ class LibraryItemRouteProvider extends DefaultHtmlRouteProvider {
      // Display library items using default theme.
      $canonical_route->setOption('_admin_route', FALSE);

      // Restrict access based on permission.
      $canonical_route->addRequirements([
        '_permission' => 'administer paragraphs library+create paragraph library item+edit paragraph library item',
      ]);
      // Restrict access to users who are allowed to update the entity.
      $canonical_route->setRequirement('_entity_access', "{$entity_type->id()}.update");
    }
    return $route_collection;
  }