Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / node_grants.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_grants.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/node_grants.twig
new file mode 100644 (file)
index 0000000..340edc3
--- /dev/null
@@ -0,0 +1,10 @@
+/**
+ * Implements hook_node_grants().
+ */
+function {{ machine_name }}_node_grants($account, $op) {
+  if (user_access('access private content', $account)) {
+    $grants['example'] = array(1);
+  }
+  $grants['example_author'] = array($account->uid);
+  return $grants;
+}