projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #10383 from MegaphoneJon/unsupervised-reserved-threshold
[civicrm-core.git]
/
CRM
/
Import
/
DataSource.php
diff --git
a/CRM/Import/DataSource.php
b/CRM/Import/DataSource.php
index 4fc206855fc8cab5ca6f33f167d633abc5ba8bad..9091e3f647a102ed124fe2b0df6a1d274f7e2488 100644
(file)
--- a/
CRM/Import/DataSource.php
+++ b/
CRM/Import/DataSource.php
@@
-3,7
+3,7
@@
+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-201
5
|
+ | Copyright CiviCRM LLC (c) 2004-201
7
|
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
@@
-28,7
+28,7
@@
/**
*
* @package CRM
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-201
5
+ * @copyright CiviCRM LLC (c) 2004-201
7
* $Id$
*
*/
* $Id$
*
*/
@@
-43,7
+43,10
@@
abstract class CRM_Import_DataSource {
* Provides information about the data source.
*
* @return array
* 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 getInfo();
@@
-72,4
+75,14
@@
abstract class CRM_Import_DataSource {
*/
abstract public function postProcess(&$params, &$db, &$form);
*/
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']);
+ }
+
}
}