Backup of database 9 Nov 17
[yaffs-website] / web / modules / contrib / permissions_by_term / src / AccessCheckInterface.php
1 <?php
2
3 namespace Drupal\permissions_by_term;
4
5 interface AccessCheckInterface {
6
7   /**
8    * Checks if a user can access a node by given node id.
9    */
10   public function canUserAccessByNodeId($iNid, $uid = FALSE);
11
12   /**
13    * Returns a boolean if the view is containing nodes.
14    */
15   public function viewContainsNode($view);
16
17   /**
18    * Removes forbidden nodes from view listing.
19    */
20   public function removeForbiddenNodesFromView(&$view);
21
22   /**
23    * @param int $tid
24    * @param bool|int $uid
25    * @return mixed
26    */
27   public function isAccessAllowedByDatabase($tid, $uid = FALSE);
28
29   /**
30    * Returns a boolean if the term is allowed by given user id.
31    *
32    * @param int $iTid
33    *   The taxonomy term id.
34    * @param int $iUid
35    *   The user id.
36    *
37    * @return bool
38    *   Determines by boolean if the given term id is allowed by given user id.
39    */
40   public function isTermAllowedByUserId($iTid, $iUid);
41
42   /**
43    * Returns a boolean if the term is allowed by given user role id.
44    *
45    * @param int $iTid
46    *   The term id.
47    * @param string $sUserRole
48    *   The user role.
49    *
50    * @return bool
51    *   Determines if the term is allowed by the given user role.
52    */
53   public function isTermAllowedByUserRole($iTid, $sUserRole);
54
55   /**
56    * Gets boolean for set permission on a term.
57    *
58    * @param int $iTid
59    *   The taxonomy term id.
60    *
61    * @return bool
62    *   Returns either TRUE or FALSE if there is any permission set for the term.
63    */
64   public function isAnyPermissionSetForTerm($iTid);
65
66 }