I'm using fullcalendar and group modules. If I create a group role 'event editor' and assign reasonable permissions, group members with that role cannot double-click on a calendar day to create a new event. (Those members may add/edit/delete events, just not via double-click.)
Looking at line 319 of src/Plugin/views/style/FullCalendar.php, it seems that the module is checking for node.add permission for the node_type 'article' only.
$settings['entityType'] = $this->view->getBaseEntityType()->id();
if (!empty($settings['bundle_type'])) {
// Can the user add a new event?
if ($settings['entityType'] === 'node') {
if ($this->accessManager->checkNamedRoute('node.add', ['node_type' => 'article'])) {
$settings['addLink'] = 'node/add/' . $settings['bundle_type'];
}
}
else {
$entity_type = $this->view->getBaseEntityType();
$entity_links = $entity_type->get('links');
if (isset($entity_links['add-form'])) {
$settings['addLink'] = str_replace('{' . $entity_type->id() . '}', $settings['bundle_type'], $entity_links['add-form']);
}
elseif (isset($entity_links['add-page'])) {
$settings['addLink'] = str_replace('{' . $entity_type->id() . '}', $settings['bundle_type'], $entity_links['add-page']);
}
}
}
I can confirm that a group member may double-click to add an event if I add the global role permission of 'Bypass content access control' or 'Article: Create new content'.
Perhaps change the line to:
if ($this->accessManager->checkNamedRoute('node.add', ['node_type' => $settings['bundle_type']])) {
I'm still wrapping my head around group permissions vs. global permission and group nodes. So I'm not sure that that change will be consistent with how other permissions interact with groups. But this does seem to solve my problem if a add that permission to the global role.
Active
3.0
Code