Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
node_access_grants
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
node_access_grants
Merge requests
!5
added hook help
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
added hook help
issue/node_access_grants-3358841:hook_help
into
8.x-2.x
Overview
0
Commits
1
Pipelines
0
Changes
1
Open
Himanshu Jhaloya
requested to merge
issue/node_access_grants-3358841:hook_help
into
8.x-2.x
2 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
8.x-2.x
8.x-2.x (HEAD)
and
latest version
latest version
92c8ee24
1 commit,
2 years ago
1 file
+
17
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
node_access_grants.module
+
17
−
0
Options
@@ -2,6 +2,7 @@
use
Drupal\Core\Session\AccountInterface
;
use
Drupal\node\NodeInterface
;
use
Drupal\Core\Routing\RouteMatchInterface
;
/**
* Implements hook_node_grants().
@@ -19,4 +20,20 @@ function node_access_grants_node_access_records(NodeInterface $node) {
/** @var \Drupal\node_access_grants\NodeAccessGrantsInterface $collection */
$collection
=
\Drupal
::
service
(
'node_access_grants.collection'
);
return
$collection
->
accessRecords
(
$node
);
}
/**
* Implements hook_help().
*/
function
node_access_grants_help
(
$route_name
,
RouteMatchInterface
$route_match
)
{
switch
(
$route_name
)
{
case
'help.page.node_access_grants'
:
$filepath
=
dirname
(
__FILE__
)
.
'/README.md'
;
if
(
file_exists
(
$filepath
))
{
$readme
=
file_get_contents
(
$filepath
);
$output
=
'<pre>'
.
$readme
.
'</pre>'
;
return
$output
;
}
}
}
\ No newline at end of file
Loading