-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcircles.module
More file actions
42 lines (33 loc) · 814 Bytes
/
circles.module
File metadata and controls
42 lines (33 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* @file
* Module file for circles.
*/
use Drupal\Core\Entity\EntityInterface;
use Drupal\node\NodeInterface;
use Drupal\Core\Session\AccountInterface;
/**
* Implements hook_node_access().
*/
function circles_node_access(NodeInterface $node, $op, AccountInterface $account, $langcode) {
switch ($op) {
case 'view':
if (\Drupal::service('circles')->canView($account, $node)) {
return NODE_ACCESS_ALLOW;
}
break;
case 'create':
break;
case 'delete':
break;
case 'update':
break;
}
// @todo Return NODE_ACCESS_IGNORE if the content is "public".
return NODE_ACCESS_DENY;
}
/**
* Implements hook_entity_access().
*/
function circles_entity_access(EntityInterface $entity, $operation, AccountInterface $account, $langcode) {
}