Skip to content
Snippets Groups Projects

hook help implemented

1 file
+ 22
0
Compare changes
  • Side-by-side
  • Inline
+ 22
0
@@ -7,6 +7,28 @@ use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Routing\Access\AccessInterface;
use Drupal\Core\Entity;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function access_by_ref_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.access_by_ref':
$output = '';
$output .= '<h2>' . t('Access by Reference') . '</h2>';
$output .= '<p>' . t('The Access By Reference module allows you to grant access to nodes based on references between users and other entities. It supports flexible permission models where access is determined dynamically through fields and entity relationships, such as user references, email addresses, or shared values.') . '</p>';
$output .= '<h3>' . t('Supported Access Methods') . '</h3>';
$output .= '<ol>' .
'<li>' . t('<b>User</b>: The node references the user.') . '</li>' .
'<li>' . t('<b>User mail</b>: The node references the user\'s email address.') . '</li>' .
'<li>' . t('<b>Profile value</b>: The node has a value matching a user\'s profile field.') . '</li>' .
'<li>' . t('<b>Inherit from parent</b>: The node references another node that the user has permissions on.') . '</li>' .
'</ol>';
$output .= '<p>' . t('Note: Permissions can be chained across multiple references. Be cautious in configuration to avoid infinite loops.') . '</p>';
return $output;
}
}
function haveNodeAccess($target_id, $op, $account){
Loading