Skip to content
Snippets Groups Projects
Commit 4636493f authored by Justin Toupin's avatar Justin Toupin
Browse files

Added field access check to custom access checker. Fixed config/install value...

Added field access check to custom access checker. Fixed config/install value for modal width. Fixed bug in ChooseComponentController.
parent 953ab6a7
No related branches found
No related tags found
3 merge requests!103Issue #3295875: Add a new dedicated permission for Layout paragraphs configurations,!27Add default width and height values for modals.,!25Provide layout info in hook_preprocess_paragraph
width: 768
width: '768'
height: auto
autoresize: true
\ No newline at end of file
......@@ -26,11 +26,12 @@ class LayoutParagraphsBuilderAccess implements AccessInterface {
*/
public function access(AccountInterface $account, LayoutParagraphsLayout $layout_paragraphs_layout) {
$entity = $layout_paragraphs_layout->getEntity();
$field_access = $layout_paragraphs_layout->getParagraphsReferenceField()->access('edit', $account, TRUE);
if ($entity->isNew()) {
return $entity->access('create', $account, TRUE);
return $entity->access('create', $account, TRUE)->andIf($field_access);
}
else {
return $entity->access('update', $account, TRUE);
return $entity->access('update', $account, TRUE)->andIf($field_access);
}
}
......
......@@ -93,7 +93,7 @@ class ChooseComponentController extends ControllerBase {
if (count($types) === 1) {
$type_name = key($types);
$type = $this->entityTypeManager()->getStorage('paragraphs_type')->load($type_name);
$response = $this->formBuilder->getForm(
$response = $this->formBuilder()->getForm(
'\Drupal\layout_paragraphs\Form\InsertComponentForm',
$layout_paragraphs_layout,
$type,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment