Fix visibility on legacy functions
[civicrm-core.git] / CRM / Utils / Hook.php
index 3f45a8fb71bf834be9e5e3e742d8d7ac4d79d55f..00b0bb7354684433a77862a53e181935db9f10d8 100644 (file)
@@ -1749,6 +1749,25 @@ abstract class CRM_Utils_Hook {
     );
   }
 
+  /**
+   * This hook is called when checking permissions; use this hook to dynamically
+   * escalate user permissions in certain use cases (cf. CRM-19256).
+   *
+   * @param string $permission
+   *   The name of an atomic permission, ie. 'access deleted contacts'
+   * @param bool $granted
+   *   Whether this permission is currently granted. The hook can change this value.
+   *
+   * @return null
+   *   The return value is ignored
+   */
+  public static function permission_check($permission, &$granted) {
+    return self::singleton()->invoke(2, $permission, $granted,
+      self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
+      'civicrm_permission_check'
+    );
+  }
+
   /**
    * @param CRM_Core_Exception Exception $exception
    * @param mixed $request
@@ -2199,8 +2218,11 @@ abstract class CRM_Utils_Hook {
   }
 
   /**
-   * This hook is called for bypass a few civicrm urls from IDS check
-   * @param array $skip list of civicrm url;
+   * This hook is called for bypass a few civicrm urls from IDS check.
+   *
+   * @param array $skip list of civicrm urls
+   *
+   * @return mixed
    */
   public static function idsException(&$skip) {
     return self::singleton()->invoke(1, $skip, self::$_nullObject,
@@ -2215,6 +2237,8 @@ abstract class CRM_Utils_Hook {
    * @param string $geoProvider
    * @param array $values
    * @param SimpleXMLElement $xml
+   *
+   * @return mixed
    */
   public static function geocoderFormat($geoProvider, &$values, $xml) {
     return self::singleton()->invoke(3, $geoProvider, $values, $xml,