if (!
$this->display_handler->
acceptAttachments()) { return;
} $this->is_attachment = TRUE;
// Find out which other displays attach to the current one.
foreach ($this->display_handler->
getAttachedDisplays() as $id) { $display_handler =
$this->displayHandlers->
get($id);
// Only attach enabled attachments that the user has access to.
if ($display_handler->
isEnabled() &&
$display_handler->
access()) { $cloned_view = Views::
executableFactory()->
get($this->storage
);
$display_handler->
attachTo($cloned_view,
$this->current_display,
$this->element
);
} } $this->is_attachment = FALSE;
} /**
* Determines if the given user has access to the view.
*
* Note that this sets the display handler if it hasn't been set.
*
* @param string $displays
* The machine name of the display.
* @param \Drupal\Core\Session\AccountInterface $account
* The user object.
*
* @return bool
* TRUE if the user has access to the view, FALSE otherwise.
*/