+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015 |
+ | Copyright CiviCRM LLC (c) 2004-2017 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
+ * @copyright CiviCRM LLC (c) 2004-2017
* $Id$
*
*/
* Provides information about the data source.
*
* @return array
- * collection of info about this data source
+ * Description of this data source, including:
+ * - title: string, translated, required
+ * - permissions: array, optional
+ *
*/
abstract public function getInfo();
*/
abstract public function postProcess(&$params, &$db, &$form);
+ /**
+ * Determine if the current user has access to this data source.
+ *
+ * @return bool
+ */
+ public function checkPermission() {
+ $info = $this->getInfo();
+ return empty($info['permissions']) || CRM_Core_Permission::check($info['permissions']);
+ }
+
}