The new column determines whether permissions will be checked when running a display
*
* Generated from org.civicrm.search_kit/xml/schema/CRM/Search/SearchDisplay.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:6042d1e2bee9eaed4c3a7c59c34ad224)
+ * (GenCodeChecksum:6d44d0c212e3f352182cac098e4d44ac)
*/
use CRM_Search_ExtensionUtil as E;
*/
public $settings;
+ /**
+ * Skip permission checks and ACLs when running this display.
+ *
+ * @var bool
+ */
+ public $acl_bypass;
+
/**
* Class constructor.
*/
'serialize' => self::SERIALIZE_JSON,
'add' => '1.0',
],
+ 'acl_bypass' => [
+ 'name' => 'acl_bypass',
+ 'type' => CRM_Utils_Type::T_BOOLEAN,
+ 'title' => E::ts('Bypass ACL Permissions'),
+ 'description' => E::ts('Skip permission checks and ACLs when running this display.'),
+ 'where' => 'civicrm_search_display.acl_bypass',
+ 'default' => '0',
+ 'table_name' => 'civicrm_search_display',
+ 'entity' => 'SearchDisplay',
+ 'bao' => 'CRM_Search_DAO_SearchDisplay',
+ 'localizable' => 0,
+ 'html' => [
+ 'type' => 'Checkbox',
+ ],
+ 'add' => '5.40',
+ ],
];
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
}
* @return bool
*/
public function upgrade_1004() {
- $this->ctx->log->info('Applying update 1000 - fix menu permission.');
+ $this->ctx->log->info('Applying update 1004 - fix menu permission.');
CRM_Core_DAO::executeQuery("UPDATE civicrm_navigation SET permission = 'administer CiviCRM data' WHERE url = 'civicrm/admin/search'");
return TRUE;
}
+ /**
+ * Upgrade 1005 - add acl_bypass column.
+ * @return bool
+ */
+ public function upgrade_1005() {
+ $this->ctx->log->info('Applying update 1005 - add acl_bypass column.');
+ $this->addTask('Add Cancel Button Setting to the Profile', 'addColumn',
+ 'civicrm_search_display', 'acl_bypass', "tinyint DEFAULT 0 COMMENT 'Skip permission checks and ACLs when running this display.'");
+ return TRUE;
+ }
+
+ /**
+ * Add a column to a table if it doesn't already exist
+ *
+ * FIXME: Move to a shared class, delegate to CRM_Upgrade_Incremental_Base::addColumn
+ *
+ * @param string $table
+ * @param string $column
+ * @param string $properties
+ *
+ * @return bool
+ */
+ public static function addColumn($table, $column, $properties) {
+ if (!CRM_Core_BAO_SchemaHandler::checkIfFieldExists($table, $column, FALSE)) {
+ $query = "ALTER TABLE `$table` ADD COLUMN `$column` $properties";
+ CRM_Core_DAO::executeQuery($query, [], TRUE, NULL, FALSE, FALSE);
+ }
+ return TRUE;
+ }
+
}
-- Generated from schema.tpl
-- DO NOT EDIT. Generated by CRM_Core_CodeGen
--
-
--- +--------------------------------------------------------------------+
--- | Copyright CiviCRM LLC. All rights reserved. |
--- | |
--- | This work is published under the GNU AGPLv3 license with some |
--- | permitted exceptions and without any warranty. For full license |
--- | and copyright information, see https://civicrm.org/licensing |
--- +--------------------------------------------------------------------+
---
--- Generated from drop.tpl
--- DO NOT EDIT. Generated by CRM_Core_CodeGen
---
-- /*******************************************************
-- *
--- * Clean up the existing tables
+-- * Clean up the existing tables - this section generated from drop.tpl
-- *
-- *******************************************************/
-- *
-- *******************************************************/
CREATE TABLE `civicrm_search_display` (
-
-
- `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique SearchDisplay ID',
- `name` varchar(255) NOT NULL COMMENT 'Unique name for identifying search display',
- `label` varchar(255) NOT NULL COMMENT 'Label for identifying search display to administrators',
- `saved_search_id` int unsigned NOT NULL COMMENT 'FK to saved search table.',
- `type` varchar(128) NOT NULL COMMENT 'Type of display',
- `settings` text DEFAULT NULL COMMENT 'Configuration data for the search display'
-,
- PRIMARY KEY (`id`)
-
- , UNIQUE INDEX `UI_saved_search__id_name`(
- saved_search_id
- , name
- )
-
-, CONSTRAINT FK_civicrm_search_display_saved_search_id FOREIGN KEY (`saved_search_id`) REFERENCES `civicrm_saved_search`(`id`) ON DELETE CASCADE
-) ROW_FORMAT=DYNAMIC ;
+ `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique SearchDisplay ID',
+ `name` varchar(255) NOT NULL COMMENT 'Unique name for identifying search display',
+ `label` varchar(255) NOT NULL COMMENT 'Label for identifying search display to administrators',
+ `saved_search_id` int unsigned NOT NULL COMMENT 'FK to saved search table.',
+ `type` varchar(128) NOT NULL COMMENT 'Type of display',
+ `settings` text DEFAULT NULL COMMENT 'Configuration data for the search display',
+ `acl_bypass` tinyint DEFAULT 0 COMMENT 'Skip permission checks and ACLs when running this display.',
+ PRIMARY KEY (`id`),
+ UNIQUE INDEX `UI_saved_search__id_name`(saved_search_id, name),
+ CONSTRAINT FK_civicrm_search_display_saved_search_id FOREIGN KEY (`saved_search_id`) REFERENCES `civicrm_saved_search`(`id`) ON DELETE CASCADE
+)
+ENGINE=InnoDB;
--
-- Generated from drop.tpl
-- DO NOT EDIT. Generated by CRM_Core_CodeGen
---
--- /*******************************************************
--- *
--- * Clean up the existing tables
+---- /*******************************************************
-- *
+-- * Clean up the existing tables-- *
-- *******************************************************/
SET FOREIGN_KEY_CHECKS=0;
<add>1.0</add>
</field>
+ <field>
+ <name>acl_bypass</name>
+ <title>Bypass ACL Permissions</title>
+ <type>boolean</type>
+ <default>0</default>
+ <comment>Skip permission checks and ACLs when running this display.</comment>
+ <add>5.40</add>
+ <html>
+ <type>Checkbox</type>
+ </html>
+ </field>
+
</table>